I was looking at Nestjs documentation to set up a microservice that listens to RabbitMQ messages. It's very straight forward when I have to listen to one queue. What if there are multiple queues that my microservice has to listen to? I was using the following method which is done in main.ts file.
await app.connectMicroservice({
transport: Transport.RMQ,
options: {
urls: ['amqp://localhost:5672'],
queue: 'q-1',
queueOptions: {
durable: false
},
},
});
Now that I have more than one queue, I can call another connectMicroservice function to do so. However, when consuming messages in my Controller, there's no way to tell my controller to which queue to listen to (either q-1 or q-2). All I know is that there's a @MessagePattern decorator that can mention what pattern to consume in that function but not sure how to mention the queue name.