rebus-org / Rebus

:bus: Simple and lean service bus implementation for .NET
https://mookid.dk/category/rebus
Other
2.31k stars 359 forks source link

Outbox question #1140

Closed dazinator closed 6 months ago

dazinator commented 7 months ago

Imagine a scenario in which an application sends a message in the ordinary way via the bus, but Sql Outbox is enabled. You expect the message to be saved to the outbox table, and then picked up in the background and dispatched to recipient queue. However in the scenario where the recipient is the same application as the sender, I think it would be desirable (as an option) to avoid sending the message to the queue and back and instead directly process it from the outbox. In other words skip the queue from the equation.

  1. I know that the queue might be important for scaling reasons - but I guess that the outbox that rebus processes messages from is also able to scale to multiple instances of the application - and an outbox message added by one instance could be eventually processed by another instance.
  2. I know that the queue might be your source of truth in terms of having dashboards and metrics and you might want all messages to be visible through it. However the option of bypassing it when a message is being dispatched to one self has its own pro's too especially if this is not the case.
mookid8000 commented 6 months ago

I definitely understand where you are going with this idea, but I am reluctant to make any changes to the outbox, because it is complex enough as it is. In fact, I am contemplating building "outbox" as a separate project, because the whole outbox concept is much more closely tied to the type of persistence, you're using, than to Rebus.

So.... I hope it's OK with you that I am closing this for now. 🙂