Skip to content

Commit

Permalink
feat(whtsapp): implementado rotina de envio de mensagem com rabbitmq.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldurans committed Jul 24, 2022
1 parent 144abce commit 7b79ee2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if (process.env.AMQP_URL) {
(async () => {
const rabbitWhatsapp = new RabbitmqServer(process.env.AMQP_URL || "");
await rabbitWhatsapp.start();
logger.info("Rabbit started", process.env.AMQP_URL);
logger.info("Rabbit started Whatsapp", process.env.AMQP_URL);
global.rabbitWhatsapp = rabbitWhatsapp;
})();
Consumer360();
Expand Down
1 change: 1 addition & 0 deletions backend/src/libs/rabbitmq-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default class RabbitmqServer {
callback: (message: Message) => Promise<void>
) {
this.channel.prefetch(1, false);
await this.channel.assertQueue(queue, { durable: true });
this.channel.consume(queue, async (message: any) => {
try {
await callback(message);
Expand Down

0 comments on commit 7b79ee2

Please sign in to comment.