Showing posts with label ActiveMQ. Show all posts
Showing posts with label ActiveMQ. Show all posts

Thursday, 1 April 2010

ActiveMQ Message Routing

There are several things to think about when you design the ActiveMQ message routing.

1) JMS Selectors. Selectors are a way of attaching a filter to a subscription to perform content based routing. Selectors are defined using SQL 92 syntax and typically apply to message headers; whether the standard properties available on a JMS message or custom headers you can add via the JMS code.
ActiveMQ message properties and JMS message properties should be considered when using JMS selectors.

2) Wildcards. ActiveMQ supports destination wildcards to provide easy support for federated name hierarchies. A subscriber could use wildcards to define hierarchial pattern matches to the destinations to subscribe from. Note wildcards are not part of the JMS specification so are custom enhancements.
I think this feature is quite useful when some messages are only interesting to part of the consumers and relation structure is complex.

3) Advisory Message. It is kind of administrative information of ActiveMQ which helps to watch the system by subscribing to regular JMS messages. By default this is disabled.

4) Message Redelivery. Messages are redelivered to a client when any of the following occurs:

  1. A transacted session is used and rollback() is called.
  2. A transacted session is closed before commit is called.
  3. A session is using CLIENT_ACKNOWLEDGE and Session.recover() is called.
(DLQ means dead letter queue)

Wednesday, 10 February 2010

Two wire protocol supported in ActiveMQ

Default wire protocol supported by ActiveMQ is Java OpenWire transport. OpenWire is used to marshal objects to byte arrays and back. http://activemq.apache.org/openwire.html
Another one is Stomp. The Stomp project is the Streaming Text Orientated Messaging Protocol site (or the Protocol Briefly Known as TTMP and Represented by the symbol :ttmp).
Stomp provides an interoperable wire format so that any of the available Stomp Clients can communicate with any Stomp Message Broker to provide easy and widespread messaging interop among languages, platforms and brokers.
I think wire protocol is the way ActiveMQ pack messages to byte arrays. OpenWire and Stomp are two different ways here. As ActiveMQ website says "OpenWire is designed for maximum performance and features; its the protocol used inside ActiveMQ. If you want a simpler protocol to work with to get started with a cross language client then tryStomp which is designed for ease-of-implementation so its easy to support many clients." So it is your choice.