ThreeDotsLabs / watermill

Building event-driven applications the easy way in Go.
https://watermill.io
MIT License
7k stars 372 forks source link

CorrelationID does not work with CQRS Facade #216

Open cotton-more opened 3 years ago

cotton-more commented 3 years ago

CommandProcessor.AddHandlersToRouter uses internally AddNoPublisherHandler to add a handler to a router CorrelationID middleware does not work. Since it assumes that the handler should return a list of new messages but AddNoPublisherHandler wraps the call into a function and always returns nil instead of messages.

When I try to wire everything manually, adds handlers to a router then the middleware works fine.

m110 commented 1 year ago

Some code snippets would help us understand the issue (I know it's been a long time). CQRS facade assumes that messages will be published using the provider Publisher, not the handler functions.