rebus-org / Rebus.AzureServiceBus

:bus: Azure Service Bus transport for Rebus
https://mookid.dk/category/rebus
Other
33 stars 20 forks source link

Possible problem with subscribers in the same IoC container #23

Closed Jeern closed 5 years ago

Jeern commented 5 years ago

When using Rebus.AzureServiceBus we experience that if several event handlers "in" a Rebus Bus'es IoC Container, listens to the same event. They influence each other in that, if one fails it causes the rest to retry.

Not desired behavior in our case, but perhaps as intended ?

I would prefer that event handlers where autonomous in the same way as when they start in different processes. I.e. all handlers listening should have a chance to process the event, even if other handlers fail.

I do not know if this has to do with Azure Service Bus or Rebus (or our setup). I did not experience it when using MSMQ as Transport, but perhaps I just never had several handlers in a Bus'es IoC Container listening to the same event.

So is this a bug (perhaps in our code) or as intendeded ?

mookid8000 commented 5 years ago

It works like that primarily because there's no way of partially receiving a message – i.e. either the message is successfully received, processed, etc., and then it is removed from the queue, or it isn't, and then it stays in the queue.

Therefore, if you want independent processing of handlers, you need separate queues.

Jeern commented 5 years ago

Ok thank you