开发者

handling timeouts with NServiceBus

i know that i can implement a message in NServiceBus with the TimeToBeReceived attribute but does nservicebus has an infrastructur开发者_运维百科e facilities for executing an event-handler when the sent message was not received after the configured time in the TimeToBeReceived attribute?


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 :)


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜