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.

Setting priority to the queue for Receive method

See original GitHub issue

Can you please provide working example for IBus.Receive(); method, which has Priority configuration for specific queue?

Documentation link should work also, but I haven’t find any documentation for IBus.Receive(); Priority configuration.

Scenario: I have 3 queues, which has many messages waiting for acknowledge. I want to set priority to one of the queues, so once all of the messages of the priority queue are acknowledged, then the messages from the other queues start reading.

I have similar to this configuration and the messages from the second_queue are read first or at the same time as the messages from first_queue. I expect that setting .WithPriority(10) will ensure messages from first_queue gets all read before the messages from second_queue.

            _bus.Receive(first_queue, registration =>
            {
                registration.Add<ExampleEvent1>(message =>
                {
                    Console.WriteLine(message.ToString());
                });
            }, configure =>
                    configure
                    .WithPrefetchCount(10)
                    .WithPriority(10));

            _bus.Receive(second_queue, registration =>
             {
                 registration.Add<ExampleEvent2>(message =>
                 {
                     Console.WriteLine(message.ToString());
                 });
             });

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
sungam3rcommented, Jul 20, 2020

Priorities work for messages within one queue, not between queues.

0reactions
sungam3rcommented, Jul 20, 2020

You can find examples in tests. Search for ‘priority’.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Priority Queue | Introduction to ...
A priority queue is a type of queue that arranges elements based on their priority values. Elements with higher priority values are ...
Read more >
PriorityQueue in Java
A PriorityQueue is used when the objects are supposed to be processed based on the priority. It is known that a Queue follows...
Read more >
Updating Java PriorityQueue when its elements change ...
You have to remove and re-insert, as the queue works by putting new elements in the appropriate position when they are inserted.
Read more >
Priority Queue pattern - Azure Architecture Center
Prioritize requests sent to services so that requests with a higher priority are received and processed more quickly than those with a lower...
Read more >
Priority Queue Support
RabbitMQ provides a priority queue implementation for classic queues. ... In most cases you will want to use the basic.qos method in manual...
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