• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Set message priority RabbitMQ/Masstransit?

Resolved: Set message priority RabbitMQ/Masstransit?

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

By following this document, I succeed in setting the priority for the RabbitMQ’s messages with x-max-priority attribute (the sample code), the received messages are prioritized. But I can’t do the same thing with the MassTransit. I found the answer here but it also doesn’t work. Here is my MassTransit configuration:
Producer’s Startup.cs:
Producer’s OrdersController.cs
Order.cs
In Consumer’s Startup.cs
OrderConsumer.cs:
The messages come randomly and not follow my priority, even I move the c.EnablePriority out to ReceiveEndpoint()method. Did I do something wrong here?
Thanks.

Answer:

Unless you specify a PrefetchCount of 1, messages are going to be pulling from the queue and processed up to the specified prefetch count.
If there are 7 messages waiting, with a mix of priorities, and the PrefetchCount is 8, all 7 will be read and processed concurrently.

If you have better answer, please add a comment about this, thank you!

.net c# masstransit rabbitmq servicebus
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: PostgreSQL resample 1 minute OHLCV candle data into 5 minute OHLCV candle data

27/03/2023

Resolved: How do I navigate a table without any easily accessible distinctions?

27/03/2023

Resolved: Can a pod make itself unavailable temporarily in kubernetes?

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.