Setting priority to the queue for Receive method
See original GitHub issueCan 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:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Priorities work for messages within one queue, not between queues.
You can find examples in tests. Search for ‘priority’.