views:

238

answers:

2

i know that i can implement a message in NServiceBus with the TimeToBeReceived attribute but does nservicebus has an infrastructure facilities for executing an event-handler when the sent message was not received after the configured time in the TimeToBeReceived attribute?

A: 

The fact that the underlying queue systems ( MSMQ, Azure Queues etc) are responsible for discarding the messages that is "to old" makes it impossible to detect when this happens.

Short answer:

No

Hope this helps!

Andreas Öhlund
+1  A: 

You can applicatively try to do this. Have the target to which you're sending the message send some kind of response back. Then, rather than just sending the message, use a saga to do so. Have the saga request a timeout for the same period as the TimeToBeReceived. In the response handler method, have the saga mark itself complete. Then, the timeout method in your saga is the callback you were looking for.

Remember that you need to run the TimeoutManager.

That's the long answer to Andreas' short answer :)

Udi Dahan