Skip to content

Commit c060d33

Browse files
committed
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.
1 parent 1e320f7 commit c060d33

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/api/services/channel.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,9 @@ export class ChannelStartupService {
721721
autoDelete: false,
722722
});
723723

724-
const queueName = `${this.instanceName}.${event}`;
724+
const eventName = event.replace(/_/g, '.').toLowerCase();
725+
726+
const queueName = `${this.instanceName}.${eventName}`;
725727

726728
await amqp.assertQueue(queueName, {
727729
durable: true,
@@ -731,7 +733,7 @@ export class ChannelStartupService {
731733
},
732734
});
733735

734-
await amqp.bindQueue(queueName, exchangeName, event);
736+
await amqp.bindQueue(queueName, exchangeName, eventName);
735737

736738
const message = {
737739
event,

0 commit comments

Comments
 (0)