Skip to content

Commit

Permalink
make RMQ connection protocol configurable (#22)
Browse files Browse the repository at this point in the history
* make RMQ connection protocol configurable

* added RMQ_PROTOCOL to dev env file

* added RMQ_PORT in dev env file
  • Loading branch information
aniketdivekar authored Sep 20, 2024
1 parent 1bb7c97 commit 6fe2561
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
HOST='127.0.0.1'
COLLECTOR_MODE='MQ'
RMQ_HOST='127.0.0.1'
RMQ_PORT='5672'
RMQ_PROTOCOL='amqp'
RMQ_USER='user'
RMQ_PASS='pass'
RMQ_CYCLES_QUEUE_NAME='cycles'
Expand Down
2 changes: 1 addition & 1 deletion src/messaging/rabbitmq/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class RMQConsumer {

private async connect(): Promise<amqp.Connection> {
return await amqp.connect({
protocol: 'amqp',
protocol: process.env.RMQ_PROTOCOL || 'amqp',
hostname: process.env.RMQ_HOST,
port: process.env.RMQ_PORT ? parseInt(process.env.RMQ_PORT) : 5672,
username: process.env.RMQ_USER,
Expand Down

0 comments on commit 6fe2561

Please sign in to comment.