fix: normalize event names in channel.service.ts

Normalized event names by replacing underscores with dots and converting to lowercase. This ensures consistent naming conventions and prevents potential issues with queue bindings.
This commit is contained in:
Davidson Gomes 2024-06-18 11:32:50 -03:00
parent 1e320f7904
commit c060d330de

View File

@ -721,7 +721,9 @@ export class ChannelStartupService {
autoDelete: false,
});
const queueName = `${this.instanceName}.${event}`;
const eventName = event.replace(/_/g, '.').toLowerCase();
const queueName = `${this.instanceName}.${eventName}`;
await amqp.assertQueue(queueName, {
durable: true,
@ -731,7 +733,7 @@ export class ChannelStartupService {
},
});
await amqp.bindQueue(queueName, exchangeName, event);
await amqp.bindQueue(queueName, exchangeName, eventName);
const message = {
event,