Is there any way to synchronously consume raw byte messages from RabbitMQ using EasyNetQ?
I need to guarantee in-order processing and acking of messages coming from a system that does not publish in EasyNetQ format. I know the consumer runs on a single thread, but the IAdvancedBus
interface only offers one method to consume raw messages:
IDisposable Consume(IQueue queue, Func<byte[], MessageProperties, MessageReceivedInfo, Task> onMessage);
The Task
return type means that the consumer is running the callback asynchronously and hence may process the messages out of order.
If not, any ideas for changing the code to support this? I would make the interface method:
IDisposable Consume(IQueue queue, Action<byte[], MessageProperties, MessageReceivedInfo> onMessage);
and implement it in RabbitAdvancedBus
, but I am not sure where the code would go exactly.