-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Pub/Sub pattern for RabbitMQ #25
Labels
Type: enhancement
New feature or request.
Comments
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Each event type has a related channel to get events from RabbitMQ. You can then have as many event handlers per channel and event type as needed.
The register method accepts a type of
EventHandler
, adding that event handler to the list of handlers that each event can have. If the bus is not subscribed to the event, it creates a new channel with a routing key using an event type so it can receive events when that event is published from any other service.Once it is done, the bus will register corresponding handlers to listen to particular events. When any message of the expected type arrives, the bus invokes the handle method of the event handler that is passed to it.
Make sure that a single handler can handle multiple different events, and multiple different handlers can handle events.
The text was updated successfully, but these errors were encountered: