mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-22 20:12:02 -06:00
ajustes rabbitmq
This commit is contained in:
parent
8f7c518487
commit
060c4e6e72
@ -71,7 +71,7 @@ export type Redis = {
|
||||
|
||||
export type Rabbitmq = {
|
||||
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
|
||||
URI: string;
|
||||
};
|
||||
@ -285,7 +285,7 @@ export class ConfigService {
|
||||
},
|
||||
RABBITMQ: {
|
||||
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',
|
||||
URI: process.env.RABBITMQ_URI || '',
|
||||
},
|
||||
|
@ -63,7 +63,7 @@ export const getAMQP = (): Channel | null => {
|
||||
export const initQueues = (instanceName: string, events: string[]) => {
|
||||
if (!instanceName || !events || !events.length) return;
|
||||
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 rabbitMode = rabbitConfig.MODE || 'isolated';
|
||||
@ -83,7 +83,7 @@ export const initQueues = (instanceName: string, events: string[]) => {
|
||||
amqp.assertQueue(queueName, {
|
||||
durable: true,
|
||||
autoDelete: false,
|
||||
// messageTtl: TWO_DAYS_IN_MS,
|
||||
messageTtl: TWO_DAYS_IN_MS,
|
||||
arguments: {
|
||||
'x-queue-type': 'quorum',
|
||||
},
|
||||
@ -101,7 +101,7 @@ export const initQueues = (instanceName: string, events: string[]) => {
|
||||
amqp.assertQueue(queueName, {
|
||||
durable: true,
|
||||
autoDelete: false,
|
||||
// messageTtl: TWO_DAYS_IN_MS,
|
||||
messageTtl: TWO_DAYS_IN_MS,
|
||||
arguments: {
|
||||
'x-queue-type': 'quorum',
|
||||
},
|
||||
@ -135,7 +135,7 @@ export const initQueues = (instanceName: string, events: string[]) => {
|
||||
amqp.assertQueue(queueName, {
|
||||
durable: true,
|
||||
autoDelete: false,
|
||||
// messageTtl: TWO_DAYS_IN_MS,
|
||||
messageTtl: TWO_DAYS_IN_MS,
|
||||
arguments: {
|
||||
'x-queue-type': 'quorum',
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user