RabbitMQ and MQServer for Event PubSub

Greetings :slight_smile:

I am exploring using ServiceStack in microservices environment and using MQServer with RabbitMQ for persistent message communication between services. My proposed design is event-driven, so the messages in the queues would be events rather than commands. I was wondering if there is any kind of support for multi-consumer messaging with RabbitMQ through the existing MQServer featureset?

Essentially I was thinking of being able to have a single event processed by multiple dependent services within the microservices portfolio with delivery guarantees.

If this is not something currently supported - would it make sense to simply implement this functionality using the underlying RabbitMQ.Client functionality, and then feeding the messages into each individual host’s ServiceStack Request Pipeline (so that I can still make use of ServiceStack for request filters etc)? Do you have any thoughts on how best to approach this, how to host this effectively within the ServiceStack App Process so that RabbitMQ and ServiceStack aren’t wrestling with one another?

Also : I considered using Redis rather than RabbitMQ here - but I am assuming that this might require some concessions with regards to delivery guarantees - is that accurate?

No the purpose of the MQ endpoints is to support an MQ endpoint abstraction to invoke ServiceStack Services, advanced Rabbit MQ features would need to use the RabbitMQ client directly.

Sure if they’re intended to invoke ServiceStack Services, AppHost.ExecuteMessage() is what the MQ Servers currently use to invoke ServiceStack Services, if your Services don’t make use of HTTP IRequest features you should be able to invoke them with the Service Gateway as well.

1 Like

that’s great - and what I expected. Thank you.sir :slight_smile:

If you were building a system of this type - would you choose Redis for PubSub over the RabbitMQ approach I’m suggesting? Or would you handle this in a different way altogether? Just interested in your opinion…

Redis Pub/Sub is easier to work with but isn’t durable where messages will only be sent & received to active connected clients, so if you need durable pub/sub you should use Rabbit MQ.

1 Like