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.

How to enable Single Active Consumer on a queue

See original GitHub issue

I need to ensure a Single Active Consumer, because a consumer needs to perform computation based on a window of events and must receive all messages.

SAC is a feature that is coming with release 3.8 and allows HA with this behaviour. http://www.rabbitmq.com/consumers.html#single-active-consumer

After some test with EasyNetQ, I didn’t find a way to set "x-single-active-consumer" argument in a queue declaration. https://github.com/EasyNetQ/EasyNetQ/wiki/The-Advanced-API#declaring-queues

How can I enable SAC with EasyNetQ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
micdennycommented, Sep 11, 2020

Also, it is probably worth to replace Exclusive consumer feature with Single-Active consumer in future versions of EasyNetQ.

I think they are different feature, I would remove/replace Exclusive only if it has been dropped or declared obsolete in rabbitmq.client

BTW I would like to add the SAC feature on the ENQ IBus, would you guys (@dpoblacion @znanev) be so kind to propose a PR for it?

1reaction
znanevcommented, Sep 11, 2020

@dpoblacion Thanks for the heads up about SAC feature! It looks quite promising.

Here’s a way to declare a queue as SAC, using the AdvancedBus:

            var sacQueue = AdvancedBus.QueueDeclare("TestSACQueue", config => config.WithArgument("x-single-active-consumer", true).AsDurable(true));

After executing the code above, I was able to verify in the management UI that the SAC argument is set:

Annotation 2020-09-11 082428

Read more comments on GitHub >

github_iconTop Results From Across the Web

Consumers
Single active consumer allows to have only one consumer at a time consuming from a queue and to fail over to another registered...
Read more >
RabbitMQ single active consumer with passive failover ...
I was thinking of using RabbitMQ as the queuing mechanism and have multiple consumers connect but have only one active consumer that will ......
Read more >
RabbitMQ 3.8 Feature Focus - Single Active Consumer
When we enable SAC on a queue, the queue no longer permits competing consumers. One SAC enabled queue can have only one consumer...
Read more >
Single Active Consumer for Streams | RabbitMQ
Single active consumer provides exclusive consumption and consumption continuity on a stream. It is also critical to get the most out of super ......
Read more >
Consumers
Single active consumer can be enabled when declaring a queue, with the x-single-active-consumer argument set to true , e.g. with the Java client:...
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