-
-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Support for consumerTag
Configuration in RabbitMQ Module
#904
Comments
@arshadazaad3 Have you explored the usage of @RabbitRPC({
routingKey: 'rpc',
exchange: 'exchange1',
queue: 'rpc',
queueOptions: {
consumerOptions: {
consumerTag: 'test-consumer',
},
},
})
rpc(message: object) {
return {
echo: message,
};
} |
Thank you, @underfisk, for the clarification! I appreciate the pointer to consumerOptions within queueOptions and the example using RabbitRPC or RabbitSubscribe. However, my request was focused on supporting consumerTag directly in the queue configuration when setting up queues via RabbitMQModule configuration (e.g., in queues array during forRootAsync or forRoot). The goal is to enable centralized configuration of consumerTag without needing to define it in decorators like RabbitRPC or RabbitSubscribe, which might not always be practical in certain dynamic or reusable module setups. Could you confirm if this approach is feasible or if there's a specific reason it’s intentionally scoped to the decorator level? Looking forward to your insights! |
@arshadazaad3 THe decorators are an easy way to inject this and I don't think we ever had the need for inject it globally and be inherited automatically which based on your use-case would reduce tons of boilerplate. If you'd like to contribute with such change, it should be easy to plug in, you only have to make sure that if a decorator has |
Description
Currently, the RabbitMQ module in
@golevelup/nestjs
does not support configuring theconsumerTag
when setting up a queue consumer. This feature would be beneficial for applications that need fine-grained control over consumer identifiers, especially in environments where multiple consumers operate on the same queue.Proposed Solution
Add a
consumerTag
option to thequeueOptions
object in the RabbitMQ configuration. This tag should be passed to the underlyingamqplib
consumer configuration.Example Usage
Here’s how the configuration could look with the new feature:
Benefits
Alternatives
Developers can currently use the managedConnection to create channels manually, but this approach:
The text was updated successfully, but these errors were encountered: