Question:
By following this document, I succeed in setting the priority for the RabbitMQ’s messages withx-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:
c.EnablePriority
out to ReceiveEndpoint()
method. Did I do something wrong here?Thanks.
Answer:
Unless you specify aPrefetchCount
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!