mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 17:38:40 -06:00
ajustes rabbitmq
This commit is contained in:
parent
8f7c518487
commit
060c4e6e72
@ -71,7 +71,7 @@ export type Redis = {
|
|||||||
|
|
||||||
export type Rabbitmq = {
|
export type Rabbitmq = {
|
||||||
ENABLED: boolean;
|
ENABLED: boolean;
|
||||||
MODE: 'isolated' | 'global' | 'single';
|
MODE: string; // global, single, isolated
|
||||||
EXCHANGE_NAME: string; // available for global and single, isolated mode will use instance name as exchange
|
EXCHANGE_NAME: string; // available for global and single, isolated mode will use instance name as exchange
|
||||||
URI: string;
|
URI: string;
|
||||||
};
|
};
|
||||||
@ -285,7 +285,7 @@ export class ConfigService {
|
|||||||
},
|
},
|
||||||
RABBITMQ: {
|
RABBITMQ: {
|
||||||
ENABLED: process.env?.RABBITMQ_ENABLED === 'true',
|
ENABLED: process.env?.RABBITMQ_ENABLED === 'true',
|
||||||
MODE: (process.env?.RABBITMQ_MODE as 'isolated' | 'global' | 'single') || 'isolated',
|
MODE: process.env?.RABBITMQ_MODE || 'isolated',
|
||||||
EXCHANGE_NAME: process.env?.RABBITMQ_EXCHANGE_NAME || 'evolution_exchange',
|
EXCHANGE_NAME: process.env?.RABBITMQ_EXCHANGE_NAME || 'evolution_exchange',
|
||||||
URI: process.env.RABBITMQ_URI || '',
|
URI: process.env.RABBITMQ_URI || '',
|
||||||
},
|
},
|
||||||
|
@ -63,7 +63,7 @@ export const getAMQP = (): Channel | null => {
|
|||||||
export const initQueues = (instanceName: string, events: string[]) => {
|
export const initQueues = (instanceName: string, events: string[]) => {
|
||||||
if (!instanceName || !events || !events.length) return;
|
if (!instanceName || !events || !events.length) return;
|
||||||
const rabbitConfig = configService.get<Rabbitmq>('RABBITMQ');
|
const rabbitConfig = configService.get<Rabbitmq>('RABBITMQ');
|
||||||
// const TWO_DAYS_IN_MS = 2 * 24 * 60 * 60 * 1000;
|
const TWO_DAYS_IN_MS = 2 * 24 * 60 * 60 * 1000;
|
||||||
const amqp = getAMQP();
|
const amqp = getAMQP();
|
||||||
|
|
||||||
const rabbitMode = rabbitConfig.MODE || 'isolated';
|
const rabbitMode = rabbitConfig.MODE || 'isolated';
|
||||||
@ -83,7 +83,7 @@ export const initQueues = (instanceName: string, events: string[]) => {
|
|||||||
amqp.assertQueue(queueName, {
|
amqp.assertQueue(queueName, {
|
||||||
durable: true,
|
durable: true,
|
||||||
autoDelete: false,
|
autoDelete: false,
|
||||||
// messageTtl: TWO_DAYS_IN_MS,
|
messageTtl: TWO_DAYS_IN_MS,
|
||||||
arguments: {
|
arguments: {
|
||||||
'x-queue-type': 'quorum',
|
'x-queue-type': 'quorum',
|
||||||
},
|
},
|
||||||
@ -101,7 +101,7 @@ export const initQueues = (instanceName: string, events: string[]) => {
|
|||||||
amqp.assertQueue(queueName, {
|
amqp.assertQueue(queueName, {
|
||||||
durable: true,
|
durable: true,
|
||||||
autoDelete: false,
|
autoDelete: false,
|
||||||
// messageTtl: TWO_DAYS_IN_MS,
|
messageTtl: TWO_DAYS_IN_MS,
|
||||||
arguments: {
|
arguments: {
|
||||||
'x-queue-type': 'quorum',
|
'x-queue-type': 'quorum',
|
||||||
},
|
},
|
||||||
@ -135,7 +135,7 @@ export const initQueues = (instanceName: string, events: string[]) => {
|
|||||||
amqp.assertQueue(queueName, {
|
amqp.assertQueue(queueName, {
|
||||||
durable: true,
|
durable: true,
|
||||||
autoDelete: false,
|
autoDelete: false,
|
||||||
// messageTtl: TWO_DAYS_IN_MS,
|
messageTtl: TWO_DAYS_IN_MS,
|
||||||
arguments: {
|
arguments: {
|
||||||
'x-queue-type': 'quorum',
|
'x-queue-type': 'quorum',
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user