Support for disabling consumers using an application config
See original GitHub issueI have many instances of my application running, some of which I’d like to consume from RabbitMQ queues and others that should be dedicated to serving API requests.
I’m using the RabbitSubscribe decorator on a service method to connect a consumer.
@RabbitSubscribe({
exchange: 'exampleExchange.created',
routingKey: 'exampleExchange.*',
queue: 'exampleExchange.created',
})
public async process(event): Promise<void> {
...
}
Is there a way to stop this from consuming from the queue based on my application config, while allowing the application to publish to the same exchanges/queues?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Control enabling/disabling Kafka consumers in Spring Boot
To disable Kafka configuration you can, for example: Annotate KafkaConsumerConfig with. @ConditionalOnProperty(value = "kafka.enabled", ...
Read more >Configure how users consent to applications - Microsoft Entra
In this article, you'll learn how to configure the way users consent to applications and how to disable all future user consent operations ......
Read more >Control access to less secure apps - Google Support
This article is for administrators. For actions users can take, go to Less secure apps & your Google Account. You can block sign-in...
Read more >Customize an AppStream 2.0 Fleet to Optimize Your Users ...
Learn how to customize an AppStream 2.0 fleet to optimize your users' application streaming experience.
Read more >Enable/disable services for a product profile - Adobe Support
Use the Adobe Admin Console to enable or disable individual services, for product profiles that are associated with a plan that includes ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@theabuitendyk This feature is now available in version
1.10.0
At first I thought that you simply wanted to disable all RabbitMQ behavior for certain instances of your application. If this were the case, you can just conditionally build up your
imports
array based on an environment/config variable and exclude the call toRabbitMQModule.forRoot/forRootAsync.
Since you also want to be able to still interact with the AmqpConnection to be able to publish messages however, this would require some tweaking to the library.
I don’t see a problem with adding in an additional configuration option that will allow you to control whether or not handlers get attached to RabbitMQ though since I can see this being a common use case that will come up. It shouldn’t be a large change, I’ll try to get a new package version pushed this week