[jboss-user] [JBoss Messaging] - Re: Messages distribution across cluster.

fl_ do-not-reply at jboss.com
Thu Jun 26 08:20:16 EDT 2008


Hello,

I made few tests and found out strange behavior.
Lets say that we have deployment layout like following:

  | (Node0) Producer ---> @ <--- Consumer (dest = 'moduleA')
  |                       |
  | (Node1)               @ <--- Consumer (dest = 'moduleB')
  |                       |
  | (Node2)               @ <--- Consumer (dest = 'moduleC')
  |                        \---- Consumer (dest = 'singleton')
  | 

All producers and consumer are standalone applications. So Producer and Consumer with selector dest = 'moduleA' are connected to Node0, Consumer with selector dest = 'moduleB' is connected to Node1 and two consumers are connected to Node2 with selectors like above.

So now, Producer send message with stringProperty set to dest='singleton' and this message stuck on Node0. It is not distributed to Node2 (in database it is assigned to Node0) and what is more important, it can't be received with Consumer connected to Node2.
We can send even few hundreds of such messages and they all stuck on Node0.

It is the same if we send message to moduleC, it just stuck on Node0.
Messages to moduleA can be received with consumer connected to Node0.

Now we close consumer connected to Node0, so now deployment looks like follow:

  | (Node0) Producer ---> @
  |                       |
  | (Node1)               @ <--- Consumer (dest = 'moduleB')
  |                       |
  | (Node2)               @ <--- Consumer (dest = 'moduleC')
  |                        \---- Consumer (dest = 'singleton')
  | 

Messages are not switched to another node, they stay attached to Node0. So Consumer with selector dest = 'singleton' is still not able to receive its messages (that are currently in queue).

Now, we send one message to module 'singleton'. And this trigger some kind of action, messages are switched to Node2, and now we can receive them by consumer (dest='singleton) connected to Node2.

I think that even after sending this one message, there is still some mess in database (and in behavior), because I had had messages with desc='moduleB' in queue before, and now they were transfered to Node2 instead of to Node1. So they stuck there to ;)  

JBoss 4.2.1 GA
JBoss Messaging 1.4.0 SP3 CP02

I don't know it is a bug? I look inside JMS specification, but there is very little about situations where few consumers with different selectors are connected to one queue especially in clustered environment.
Nevertheless I think it is expected that above situation will be working "correctly" ;) it means each message will be received by corresponding consumer.

There are two other things that I noticed:
1) a lot of SQL updates
When messages are switching across cluster, there is a lot of database UPDATE operation. It can impact performance, can't it?
2) message order 
This 'message switching' breaks any order in queue. I don't want start discussion about that order should be kept or not.
My question is: Is there chance that one of message will be extremely unlucky and will be never consumed ? 
In situation where we have constantly a lot of messages in queue: producers are adding new messages and consumers are receiving them little slower; we expect that old messages will be generally consumed before new one. 
I think that in current approach, it is possible that one message will be on some "switching mode" state every time when consumers request message to consume. And it stuck in queue.

BR

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

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



More information about the jboss-user mailing list