Rebus OneWayClient create queue if not exists

Viewed 357

I'm having an error sending messages (not publishing) with rebus when configured as one way client (RabbitMq and Azure) because the queues must exists.

Is there a way with OneWayClient to create queues if not exists before sending messages?

1 Answers

Rebus' RabbitMQ transport intentionally doesn't create destination queues if they do not exist – instead, it throws an exception.

This way, its behavior aligns with other transports like MSMQ, Azure Service Bus, Amazon SQS, etc., since they all throw an exception if you accidentally send to a non-existent queue.

The reasoning behind this behavior, is that it's almost always an error, if you send to a queue that doesn't exist – because, when you send a message to a queue, it's a sign that you care about the message, and you care that a special someone is going to have it, but if that special someone doesn't exist, you most likely want to know it as fast as possible.

Related