Skip to content

Commit ec79864

Browse files
committed
rabbitmq
1 parent 0b23153 commit ec79864

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/libs/amqp.server.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ let amqpChannel: amqp.Channel | null = null;
1010
export const initAMQP = () => {
1111
return new Promise<void>((resolve, reject) => {
1212
const uri = configService.get<Rabbitmq>('RABBITMQ').URI;
13-
const exchangeName = configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME ?? 'evolution_exchange';
1413
amqp.connect(uri, (error, connection) => {
1514
if (error) {
1615
reject(error);
@@ -23,6 +22,8 @@ export const initAMQP = () => {
2322
return;
2423
}
2524

25+
const exchangeName = 'evolution_exchange';
26+
2627
channel.assertExchange(exchangeName, 'topic', {
2728
durable: true,
2829
autoDelete: false,
@@ -50,7 +51,7 @@ export const initQueues = (instanceName: string, events: string[]) => {
5051

5152
queues.forEach((event) => {
5253
const amqp = getAMQP();
53-
const exchangeName = configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME ?? instanceName;
54+
const exchangeName = instanceName ?? 'evolution_exchange';
5455

5556
amqp.assertExchange(exchangeName, 'topic', {
5657
durable: true,
@@ -80,7 +81,7 @@ export const removeQueues = (instanceName: string, events: string[]) => {
8081
return `${event.replace(/_/g, '.').toLowerCase()}`;
8182
});
8283

83-
const exchangeName = configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME ?? instanceName;
84+
const exchangeName = instanceName ?? 'evolution_exchange';
8485

8586
queues.forEach((event) => {
8687
const amqp = getAMQP();

src/whatsapp/services/whatsapp.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
Database,
1414
HttpServer,
1515
Log,
16-
Rabbitmq,
1716
Sqs,
1817
Webhook,
1918
Websocket,
@@ -686,7 +685,7 @@ export class WAStartupService {
686685

687686
if (amqp) {
688687
if (Array.isArray(rabbitmqLocal) && rabbitmqLocal.includes(we)) {
689-
const exchangeName = this.configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME ?? this.instanceName;
688+
const exchangeName = this.instanceName ?? 'evolution_exchange';
690689

691690
amqp.assertExchange(exchangeName, 'topic', {
692691
durable: true,

0 commit comments

Comments
 (0)