[jboss-user] [JBoss Messaging] - Re: Message redistribution

martin.wickus do-not-reply at jboss.com
Mon Feb 18 05:28:04 EST 2008


Precondition: JBM cluster consisting of two nodes posting messages to a clustered queue. The JBM cluster is formed across JBoss nodes.

Step1. Start up a plain java process (configured with JBM client libraries and patched JBoss Remoting lib) which looks up a ClusteredConnectionFactory from the JBoss/JBM partition via JNDI, creates a connection then registers a MessageListener to receive messages. Let's say the resulting connection is attached to node 1 of the JBM cluster. 

Step2. Send a message from node 1 of the JBM cluster to the clustered queue. The message is immediately received by the message listener.

Step3. Send a message from node 2 of the JBM cluster. The message is not received by the message listener.

Step4. Kill the external java process hosting the MessageListener.

Step5. Start the external java process hosting the MessageListener. This is a repeat of Step1, but this time my connection is to node 2. Backlog of messages sent from node 2 are immediately received.

Step6. Send a message from node 2 of the JBM cluster to the clustered queue. The message is immediately received by the message listener.

Step7. Send a message from node 1 of the JBM cluster. The message is not received by the message listener.

Red Hat JBoss support has let me know that a consumer on node 1 is able to consume messages on the same distributed queue hosted on node 2. However, the messages will not be "sucked" over until the local queue is empty.  So, for example, if Consumer A is connected to node 1, messages in the distributed queue on node 2 will not be moved to node 1 until Consumer A has exhausted all messages in the queue on node 1. That is, messages queued to node 1 would have precedence over messages queued to node 2 for Consumer A.

Two things from this then:

1. I am not seeing the behavior described by Red Hat (messages seem to stay stuck in their original node).
2. The behavior described by Red Hat would mean that if any activity is generated by node 1 (eg. even just 1 message on the distributed queue for node 1) then none of the messages on node 2 will get delivered since they won't be sucked over to node 1. 

I'd prefer being able to look at the distributed queue as a single virtual queue from which my consumer can take messages without having to worry from where a message originated.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130044#4130044

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130044



More information about the jboss-user mailing list