Shouldn't Outbox be used only for publishing IntegrationEvents? #185
Replies: 1 comment
-
Hi @pawelpodsiadly, In my opinion Outbox should be used for all non-transactional operations like integration with another module, sending e-mail, communicate with 3rd party system, and internal, outside of transaction processing. I don't think it is a good idea to introduce a new interface for events and omit the outbox step during processing internal operation. What is important, Outbox holds events (not messages!) which should be processed somehow - the event shouldn't know how it will be processed, it represents just a fact. This is why I would not split events into 2 streams (outbox for external communication and another for internal processing). This flow event -> command -> event -> command ... -> is natural, that's how systems work conceptually. |
Beta Was this translation helpful? Give feedback.
-
Hey,
From what I can see Notification handlers saved in the Outbox do one of the following:
I think it would be a cleaner solution for Outbox to only serve one purpose which is sending messages to other modules.
I don't understand why some Notifications are first saved to Outbox and later handlers save another command to InteralCommands, which is later processed to finally execute business logic.
I was thinking of maybe introducing another interface besides IDomainEventNotification that would be used for commands that should be processed outside of transaction, but inside the module. These commands would be saved directly to InternalCommands.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions