mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 01:41:24 -06:00
Merge branch 'release/2.2.2'
This commit is contained in:
commit
14fea2f5e0
@ -49,6 +49,8 @@ RABBITMQ_URI=amqp://localhost
|
||||
RABBITMQ_EXCHANGE_NAME=evolution
|
||||
# Global events - By enabling this variable, events from all instances are sent in the same event queue.
|
||||
RABBITMQ_GLOBAL_ENABLED=false
|
||||
# Prefix key to queue name
|
||||
RABBITMQ_PREFIX_KEY=evolution
|
||||
# Choose the events you want to send to RabbitMQ
|
||||
RABBITMQ_EVENTS_APPLICATION_STARTUP=false
|
||||
RABBITMQ_EVENTS_INSTANCE_CREATE=false
|
||||
|
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,3 +1,13 @@
|
||||
# 2.2.2 (2025-01-31 06:55)
|
||||
|
||||
### Features
|
||||
|
||||
* Added prefix key to queue name in RabbitMQ
|
||||
|
||||
### Fixed
|
||||
|
||||
* Update Baileys Version
|
||||
|
||||
# 2.2.1 (2025-01-22 14:37)
|
||||
|
||||
### Features
|
||||
|
@ -3,7 +3,7 @@ FROM node:20-alpine AS builder
|
||||
RUN apk update && \
|
||||
apk add git ffmpeg wget curl bash openssl
|
||||
|
||||
LABEL version="2.2.1" description="Api to control whatsapp features through http requests."
|
||||
LABEL version="2.2.2" description="Api to control whatsapp features through http requests."
|
||||
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"
|
||||
LABEL contact="contato@atendai.com"
|
||||
|
||||
|
1000
package-lock.json
generated
1000
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "evolution-api",
|
||||
"version": "2.2.1",
|
||||
"version": "2.2.2",
|
||||
"description": "Rest api for communication with WhatsApp",
|
||||
"main": "./dist/main.js",
|
||||
"type": "commonjs",
|
||||
|
@ -87,6 +87,7 @@ export class RabbitmqController extends EventController implements EventControll
|
||||
const rabbitmqLocal = instanceRabbitmq?.events;
|
||||
const rabbitmqGlobal = configService.get<Rabbitmq>('RABBITMQ').GLOBAL_ENABLED;
|
||||
const rabbitmqEvents = configService.get<Rabbitmq>('RABBITMQ').EVENTS;
|
||||
const prefixKey = configService.get<Rabbitmq>('RABBITMQ').PREFIX_KEY;
|
||||
const rabbitmqExchangeName = configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME;
|
||||
const we = event.replace(/[.-]/gm, '_').toUpperCase();
|
||||
const logEnabled = configService.get<Log>('LOG').LEVEL.includes('WEBHOOKS');
|
||||
@ -159,7 +160,9 @@ export class RabbitmqController extends EventController implements EventControll
|
||||
autoDelete: false,
|
||||
});
|
||||
|
||||
const queueName = event;
|
||||
const queueName = prefixKey
|
||||
? `${prefixKey}.${event.replace(/_/g, '.').toLowerCase()}`
|
||||
: event.replace(/_/g, '.').toLowerCase();
|
||||
|
||||
await this.amqpChannel.assertQueue(queueName, {
|
||||
durable: true,
|
||||
@ -195,6 +198,7 @@ export class RabbitmqController extends EventController implements EventControll
|
||||
|
||||
const rabbitmqExchangeName = configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME;
|
||||
const events = configService.get<Rabbitmq>('RABBITMQ').EVENTS;
|
||||
const prefixKey = configService.get<Rabbitmq>('RABBITMQ').PREFIX_KEY;
|
||||
|
||||
if (!events) {
|
||||
this.logger.warn('No events to initialize on AMQP');
|
||||
@ -207,7 +211,10 @@ export class RabbitmqController extends EventController implements EventControll
|
||||
eventKeys.forEach((event) => {
|
||||
if (events[event] === false) return;
|
||||
|
||||
const queueName = `${event.replace(/_/g, '.').toLowerCase()}`;
|
||||
const queueName =
|
||||
prefixKey !== ''
|
||||
? `${prefixKey}.${event.replace(/_/g, '.').toLowerCase()}`
|
||||
: `${event.replace(/_/g, '.').toLowerCase()}`;
|
||||
const exchangeName = rabbitmqExchangeName;
|
||||
|
||||
this.amqpChannel.assertExchange(exchangeName, 'topic', {
|
||||
|
@ -97,6 +97,7 @@ export type Rabbitmq = {
|
||||
EXCHANGE_NAME: string;
|
||||
GLOBAL_ENABLED: boolean;
|
||||
EVENTS: EventsRabbitmq;
|
||||
PREFIX_KEY: string;
|
||||
};
|
||||
|
||||
export type Sqs = {
|
||||
@ -355,6 +356,7 @@ export class ConfigService {
|
||||
RABBITMQ: {
|
||||
ENABLED: process.env?.RABBITMQ_ENABLED === 'true',
|
||||
GLOBAL_ENABLED: process.env?.RABBITMQ_GLOBAL_ENABLED === 'true',
|
||||
PREFIX_KEY: process.env?.RABBITMQ_PREFIX_KEY || 'evolution',
|
||||
EXCHANGE_NAME: process.env?.RABBITMQ_EXCHANGE_NAME || 'evolution_exchange',
|
||||
URI: process.env.RABBITMQ_URI || '',
|
||||
EVENTS: {
|
||||
|
Loading…
Reference in New Issue
Block a user