Skip to content
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

RabbitMQ improvements #451

Merged

Conversation

judsonjuniorr
Copy link
Contributor

@judsonjuniorr judsonjuniorr commented Mar 4, 2024

In this PR we improved the RabbitMQ feature, by adding 3 modes to it:

isolated
In this mode each instance will have an exchange and linked to a queue defined by the name of the events, the exchanges will be binded to them:
The exchange name will be the instance name

Screenshots ![isolated_exchanges](https://github.com/EvolutionAPI/evolution-api/assets/44608323/764ef122-342b-40a4-a708-561393f41839) ![isolated_queues](https://github.com/EvolutionAPI/evolution-api/assets/44608323/2a1cd8c5-04f0-452e-bc47-0820f147fbf4) ![isolated_queue](https://github.com/EvolutionAPI/evolution-api/assets/44608323/29275cf3-277a-4131-9431-c6e6c00fcbdb)

single
In this mode we'll have one exchange and one queue.
The exchange name can be customized from the env file
The queue name will be evolution

Screenshots ![single_exchanges](https://github.com/EvolutionAPI/evolution-api/assets/44608323/d87eedd9-b582-48ef-a62d-69b8b694ae9b) ![single_queues](https://github.com/EvolutionAPI/evolution-api/assets/44608323/844b9822-d7f3-4459-a27a-4ec8c0f798ba)

global
IMO this is the best option In this mode will have one exchange and 5 queues, each queue will be grouped by a few events, you can check on the screenshots bellow:
The exchange name can be customized from the env file

Screenshots ![global_exchanges](https://github.com/EvolutionAPI/evolution-api/assets/44608323/6395e310-881e-4376-bb69-09892ffd9431) ![global_queues](https://github.com/EvolutionAPI/evolution-api/assets/44608323/4d69d7cc-f7bf-4b5e-8023-68e16085a341) ![global_events](https://github.com/EvolutionAPI/evolution-api/assets/44608323/8464fd87-33f0-4694-8efc-647de5f5f9cb)

2 new parameters has been added to env file:
RABBITMQ_RABBITMQ_MODE=global -> acceps single/global/isolated
RABBITMQ_EXCHANGE_NAME=evolution_exchange -> will only be used in global/single

@judsonjuniorr judsonjuniorr changed the title Make rabbitMQ per events RabbitMQ improvements Mar 4, 2024
@DavidsonGomes
Copy link
Collaborator

Excellent contribution, I have some points, there is a console.log in the middle of the code if you can remove it, it is cleaner, does the old configuration remain functional if I don't configure the envs? we need to avoid break changes as much as possible

@judsonjuniorr
Copy link
Contributor Author

@DavidsonGomes logs removed and code adapted to be compatible with current working services event without informing the env variables

@DavidsonGomes DavidsonGomes merged commit b04ed66 into EvolutionAPI:develop Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants