2

I'm building a system using NSerivceBus, that should only send the messages to a remote handler on a specific time frames. So far, I managed to place all the messages on a processing queue and from there check for availability of the remote handler, and if the handler is not available, I'm not sending the messages over the boundary. To do this I'm using

Bus.HandleCurrentMessageLater()

but NSB will keep trying right after. It is not like the other listener is going to be up and running in a few minutes, but it may have hours of outage window, so this is not exactly efficient.

Wondering if there's way to have the bus retry the message on some time later, or do not keep retrying and wait for an amount of time before next retry. I'm going using Sagas, just simple command/handler messaging.

Hadi Eskandari
  • 25,575
  • 8
  • 51
  • 65

1 Answers1

5

You can use Bus.Defer to get the message back after a certain timespan has elapsed in version 3.0.

Udi Dahan
  • 11,932
  • 1
  • 27
  • 35
  • hello udi, i am working with nservicebus 5.0 and in 5.0 bus.createinstance<> method is obsolete , so for making a synchronous call i was using bus.createinstance in version 4.6.5 , but now i am not able to migrate my code to higher version , let me know what is the possible way to send a reply back to same request , the call i want should be synchronous . – Friyank Apr 04 '15 at 09:39
  • The reason CreateInstance was obsoleted was because it isn't really needed - you can Bus.Reply(lambda to create the message). – Udi Dahan Apr 06 '15 at 05:50