How manage transaction between domain logic and events in DDD?
问题 I am studying on the programming in DDD and event source. I saw one example that when a domain logic was called (e.g. Order.placeOrder() ) it would publish an event (e.g. OrderPlaced ). And the event would be sent to MQ as the event store. The domain logic ( Order.placeOrder() ) should be an atomic API, and it should have @Transactional annotation if using Spring for the transaction manager. And now my question is: How to make sure the DB change and event sending are within the same