Shuttle / Shuttle.Esb

A highly extensible service bus implementation.
http://shuttle.github.io/shuttle-esb/
BSD 3-Clause "New" or "Revised" License
95 stars 30 forks source link

How can I defer a message inside a handler #25

Closed nohros closed 7 years ago

nohros commented 7 years ago

Hi,

What is the best to defer a message inside the [ProcessMessage] method of a handler. I need to resend the message or just set the [IgnoreTillDate]?

eben-roux commented 7 years ago

If you simply want to defer the same message I guess you could send it locally again. The handler would return as successful and the current message would be acknowledged:

context.Send(context.Message, c => c.Local().Defer(DateTime.Now.AddMinutes(5)));

Remember to have a deferredQueueUri configured else your inbox will be thrashed.