0

Is it possble to configure the Publisher to run in fixed interval, say every hour? In the example I downloaded from the NServiceBus web site, the publisher publishes whenever a user hit enter key. So, instead of that, I would like to publish a message every hour.

Thanks.

Tony
  • 3,319
  • 12
  • 56
  • 71
  • I think I can just add a timer and have publisher publishes when the time event fired. – Tony Mar 16 '11 at 17:05

1 Answers1

2

You can set up a timer from an IWantToRunAtStartup class's Run method. Then publish to the bus every time the timer fires.

David Boike
  • 18,545
  • 7
  • 59
  • 94
  • 2
    I made a simple and pretty slick solution to scheduling recurring tasks in an NServiceBus service this way, and it works like a charm. You can see more here: http://mookid.dk/oncode/archives/1507 – mookid8000 Mar 16 '11 at 18:13