Version 15

    Does JBossMQ Support Load Balancing


    The short answer is no (in the traditional sense of the word).


    In fact, JBossMQ by itself has no support for any clustering features as a server (replication, load balancing or failover).


    So what is HAJMS


    HAJMS as the name implies makes JBossMQ HA (highly available).


    It uses JBoss Clustering Framework's Singleton Service to ensure that the JBossMQ server instance is active on one node (and only one node) in the cluster, making the JBossMQ instance highly available.


    For replication of state it uses the database. HAJNDI is used to discover which node in the cluster has the server instance via the jms ConnectionFactory lookup.


    What about load balancing?


    Load balancing in the context of queues makes little sense. It would be a bit like load balancing a stateful session bean instance (which just requires failover).


    Load balancing of topics does make sense, i.e. distribute topic subscriptions across the cluster. However JBossMQ does not support this topology.


    Don't other JMS implementations support load balancing?


    For Topics maybe, for Queues they almost certianly just provide "transparent" access to a singleton Queue.

    i.e. you can contact any node of a cluster to talk to the queue.


    I've heard people talk about MDB load balancing.


    This is not load balancing in the traditional sense. This is just contested Queues. i.e. you have more than one receiver on different machines receiving from the queue. This load balances the work done by the queue receiver not the queue itself (and it is almost certainly all that you need anyway?).


    The MDB load balancing does not work very well, only one MDB receives the messages unless there is high load?


    That is because of an implementation detail in Sun's HashSet implementation which is used to store waiting receivers. To make the waiting receivers operate in FIFO fashion (for round-robin distribution), change the configuration of the ReceiversImpl.


    Where is the HAJMS config?


    The config can be found in



    I don't want HAJMS in the all configuration


    Just remove


    and replace


    with the version from