Search code examples
rabbitmqmasstransit

MassTransit RabbitMQ Streams


I would like to try the RabbitMQ Streams with MassTransit. The objective is to define the configuration for only a subsets of the queues.

I managed to add the queue arguments when the consumer is configured using the code :

rabbitmqConfigurator.SetQueueArgument("x-queue-type", "stream");

It does creates the queue has expected.

However, the command is sent from an another process (which is not consuming), and when I try to send the command, the app hangs and I can see on the rabbitmq an error message :

operation queue.declare caused a channel exception precondition_failed: inequivalent arg 'x-queue-type' for queue 'MyCommand' in vhost 'vhost_1': received 'classic' but current is 'stream'

I assume I should also define the queue argument in the producer process, but I cannot figure out how to do that.


Solution

  • The error you're seeing is because you're trying to explicitly send to a queue from another process. Try sending to the exchange instead (using exchange:name as the endpoint address).