How to use RoutingKey with ServiceStack and RabbitMQ

I have two identical sites that will consume RabbitMQ messages using the new Rabbit MQ client . A manufacturer should ideally be able to assign a site either by queue name or by routing key. The first thing I can do as a publishing option, but the last one I don't have access to. Also, on the service side, the consumer can only subscribe to the queue names based on conventions, i.e. mq.myrequest.inq, and I seem to be unable to use the routing key.

Is there a way to publish and subscribe using my own routing key or register a handler based on the explicit queue name, i.e. mq.myrequest.site1.inq?

+3
source share
1 answer

No. ServiceStack RabbitMq is usually based on type names and is said to function as a work queue. It was designed to be unconfigured and easy to use, so it automatically takes care of the exchange details, routing keys, and queue names to use.

If you need advanced or custom configuration, it is better to use RabbitMQ.Client instead .

+2
source

All Articles