0

I am trying to find the most light-weight message bus (queue?) that can handle the following:

  1. Producer A subscribes to the bus. The bus is specified via a well known form of identification (like a name, a socket or something).
  2. Consumer B subscribes to the same bus and registers to only a certain kind of messages.
  3. Consumer C subscribes to the same bus and registers to another kind of messages that overlaps with that of B.
  4. Producer A puts a message in the bus such that both B and C are interested in. Both B and C receive the message (not just one of them, but both of them).

A, B, C and the bus are residing in different machines.

Ashkan Kh. Nazary
  • 21,844
  • 13
  • 44
  • 68

2 Answers2

1

You are probably best using a queue (such as ActiveMQ) for this and for the lightweight requirement, you can use MQTT as the underlying protocol which is extremely lightweight.

See: http://activemq.apache.org/mqtt.html

http://mqtt.org/

For your scenario:

  1. Your producer A will connect to the queue

  2. Your consumer B will connect to the same queue and listens to a topic (for instance /topic/onlyBisInterested). It will also subscribe to /topic/everyoneIsInterested

  3. Your consumer C will connect to the queue and listens to /topic/everyoneIsInterested

    1. Your producer will publish a message to /topic/everyoneIsInterested and both B and C will receive this message.

You can play around with the topics a lot. You can have topic matching rules on a wildcard basis, on an exact basis or any combination thereof. There are also levels of hierarchy (such as /a/b/*) that can be setup which will accept (/a/b/c or /a/b/d or anything else).

You can also transfer your data over SSL and use authentication if required and use message persistence and guaranteed delivery in case one/many of your node(s) go down.

I recommend reading the official documentation and deciding if it's good enough for you. There are plenty of other free or commercial queues available, most/all of which will satisfy your requirements since they are very standard.

kha
  • 19,123
  • 9
  • 34
  • 67
0

We've written a peer-to-peer message bus, Zebus, based on ZeroMq (transport), Cassandra (peer discovery and persistence) and Protobuf (serialisation). It supports routing of messages based on properties of the messages.

It is open source and production tested https://github.com/Abc-Arbitrage/Zebus

Zebus is being actively developed and it is in heavy in-house production use. Currently there is only a .NET language binding.

Slugart
  • 4,535
  • 24
  • 32