mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 17:38:40 -06:00
fix: exchange rabbitmq
This commit is contained in:
parent
3ccb983377
commit
d8ce23f2a0
@ -27,6 +27,7 @@ export const initAMQP = () => {
|
|||||||
channel.assertExchange(exchangeName, 'topic', {
|
channel.assertExchange(exchangeName, 'topic', {
|
||||||
durable: true,
|
durable: true,
|
||||||
autoDelete: false,
|
autoDelete: false,
|
||||||
|
assert: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
amqpChannel = channel;
|
amqpChannel = channel;
|
||||||
@ -43,7 +44,7 @@ export const getAMQP = (): amqp.Channel | null => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const initQueues = (instanceName: string, events: string[]) => {
|
export const initQueues = (instanceName: string, events: string[]) => {
|
||||||
if (!events || !events.length) return;
|
if (!instanceName || !events || !events.length) return;
|
||||||
|
|
||||||
const queues = events.map((event) => {
|
const queues = events.map((event) => {
|
||||||
return `${event.replace(/_/g, '.').toLowerCase()}`;
|
return `${event.replace(/_/g, '.').toLowerCase()}`;
|
||||||
@ -56,6 +57,7 @@ export const initQueues = (instanceName: string, events: string[]) => {
|
|||||||
amqp.assertExchange(exchangeName, 'topic', {
|
amqp.assertExchange(exchangeName, 'topic', {
|
||||||
durable: true,
|
durable: true,
|
||||||
autoDelete: false,
|
autoDelete: false,
|
||||||
|
assert: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const queueName = `${instanceName}.${event}`;
|
const queueName = `${instanceName}.${event}`;
|
||||||
@ -89,6 +91,7 @@ export const removeQueues = (instanceName: string, events: string[]) => {
|
|||||||
amqp.assertExchange(exchangeName, 'topic', {
|
amqp.assertExchange(exchangeName, 'topic', {
|
||||||
durable: true,
|
durable: true,
|
||||||
autoDelete: false,
|
autoDelete: false,
|
||||||
|
assert: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const queueName = `${instanceName}.${event}`;
|
const queueName = `${instanceName}.${event}`;
|
||||||
|
@ -779,6 +779,7 @@ export class WAStartupService {
|
|||||||
amqp.assertExchange(exchangeName, 'topic', {
|
amqp.assertExchange(exchangeName, 'topic', {
|
||||||
durable: true,
|
durable: true,
|
||||||
autoDelete: false,
|
autoDelete: false,
|
||||||
|
assert: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const queueName = `${this.instanceName}.${event}`;
|
const queueName = `${this.instanceName}.${event}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user