0 Replies Latest reply on Nov 14, 2007 1:03 PM by Tim Fox

    Singleton consumer support native in JBM

    Tim Fox Master

      As we all know, JBoss MQ HA is based around the idea of a HASingleton - only one node in the cluster is active at any one time,

      With JBM on the other hand, each node is active concurrently. While this is an advantage in most use cases, there is one use case where the HASingleton approach is useful - this is when you want to ensure that messages are processed from a queue sequentially by a single consumer.

      This is trivial in JBoss MQ since there is only one node, but with JBM is not so simple.

      We could deploy the MDB as a ha singleton - this would ensure it only gets deployed on one node - however producer connections would be distributed across the cluster giving unnecessary network trips - we would really want all connections to be made to the node where the consumer is.

      We could then deploy a connection factory with loadbalancing=false also in deploy-hasingleton - this would ensure the connections are on the same node.

      If failure occurs the queue would failover onto another node - all well and good.

      If the system is then stopped and restarted, the ha singleton node would be chosen to be the first node started, but the node with the messages would be another node, so messages would be sucked from that node as new ones are arriving on the new singleton node. This would message processing would go out order.

      If we want to support this use case, a simple solution for now for people who want JBoss MQ style functionality is just to deploy the whole of JBM in the deploy-hasingleton directory, and we could then think about implementing native singleton functionality in JBM 2.