question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for disabling consumers using an application config

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
WonderPandacommented, Jan 22, 2020

@theabuitendyk This feature is now available in version 1.10.0

1reaction
WonderPandacommented, Jan 21, 2020

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 to RabbitMQModule.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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found