ThreeDotsLabs / watermill

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

[watermill-http] It doesn't support multi subscribes for the same single topic #280

Open tymonx opened 2 years ago

tymonx commented 2 years ago

The go-chi HTTP router used in the Watermill HTTP overrides added handlers for the same route. Because of that when calling httpSubscriber.Subscribe(ctx, url) with the same url N times it will invoke added HTTP handlers only once. Simple use case for the CQRS component with queue per package name not per packageName.CommandName/EventName. Received message from HTTP client will be delivered randomly only to one of registered command or event handler with the same topic name not to all added handlers. In that case the Watermill HTTP doesn't work as pub/sub.

tymonx commented 2 years ago

I have prepared Pull Request with necessary fixes for this issue https://github.com/ThreeDotsLabs/watermill-http/pull/10 I don't know why CI fails for go build ./.... Locally it works perfectly fine without any problems.