Question:By following this document, I succeed in setting the priority for the RabbitMQ’s messages with
x-max-priorityattribute (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:
ReceiveEndpoint()method. Did I do something wrong here?
Answer:Unless you specify a
PrefetchCountof 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!