Java – Allen MQ: Multiple subscription

Allen MQ: Multiple subscription… here is a solution to the problem.

Allen MQ: Multiple subscription

I am currently working on PoCs on Aeron MQ. According to the PoC, I have 2 subscriptions and 1 publisher for a local channel with embedded media drivers. The published message is received in both subscriptions, and I want to distribute the message in a circular fashion. Is there a property or method that does this?

Solution

Out of the box, Aeron supports:

  • One-to-one (single publish to a single subscription).
  • Many-to-one (many publications published to one subscription).
  • One-to-many (publishing a single publication to multiple subscriptions using UDP multicast or UDP unicast-based MDC).

In all cases, the receiver gets all messages from the moment it joins the flow. There’s nothing out of the box that gives you this circular semantics.

Theoretically, you can use the primitives provided by Aeron to build a central component that distributes messages in a round-robin fashion to a set of components that request work.

Depending on your use case, you’d better consider a solution like RabbitMQ out of the box.

Related Problems and Solutions