Hi Jason,
The way we implemented the message delivery this behaviour could happen, but
only when messages are arriving more slowly than they are being requested.
This is because the set of receivers waiting for messages is a HashSet so
that if a receiver sends a request for a message more than once (which
happens when using a receive with a timeout) it won't get added more than
once.
What this means is that if you have multiple receivers waiting for a message
from a queue and a message arrives then it will be immediately delivered to
receiver A. Receiver A is now removed from the HashSet, however if receiver
A finishes its processing and requests another message before another
message is sent to the queue it will be added back to the HashSet. When the
next message arrives set will again be sent to receiver A because in the
HashSets ordering receiver A is clearly ahead of receiver B.
We didn't see any problem with this at the time, under heavy client
processing loads where messages are waiting on the queue as requests are
made then the messages will be shared out amongst the clients. When there
is light loads then the messages will tend to be delivered to the same
client.
We could implement an ordering on the server-side but I still don't know if
it is required. Remember this only happens when your clients are going fast
enough that they actually have to wait for messages to arrive. If messages
are being produced faster than the clients can process them then they will
be shared out amongst all the clients.
Cheers
David
> -----Original Message-----
> From: Jason Dillon [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 22, 2001 11:06 AM
> To: [EMAIL PROTECTED]
> Subject: [JBoss-dev] jbossmq & load balancing across vms
>
>
> Hello again, I am running into a problem with the latest
> JBossMQ wrt using
> it to load balance across machines.
>
> I have one machine which acts as a message router, running
> JBossMQ. All
> other machines use it for their JMSProvider. When I have
> more than one MDB
> attached to a single queue, and a user-thread adding messages
> over and over,
> it looks like only one of the MDB's will ever read any messages.
>
> I do not remember seeing this before. It looks like when I
> startup a new
> MDB that 50% of the time it will take over and the others
> will remain idle,
> or it will simply never read any new messages.
>
> I have each of these MDB setup with:
>
> <MaximumSize>1</MaximumSize>
> <MaxMessages>1</MaxMessages>
>
> Which could be causing problem... but honestly I don't really
> know what
> these two setting actually do. I wanted to have these
> deployed MDB's to
> only process one message at a time, which this seems to
> accomplish most of
> the time.
>
> Any ways, I am concerended about how JBossMQ is pushing
> messages over to
> consumers. I mentioned before that if one producer added 1k
> messages to a
> queue, then one MDB was attached which would suck up all of
> the messages.
> When a second MDB was attached it would not have anything todo. Hiram
> mentioned something about this, but I am not really sure what
> the plans were
> to fix this.
>
> I would like to get this fixed soon, as I am fairly dependent on this
> behavior.
>
> From my perspective, there are two major issues:
>
> 1) JBossMQ does not seem to trade off between consumers (ie.
> round-robin or
> whatever).
>
> 2) JBossMQ does not have any configurable limits on how
> messages are pushed
> from the server to clients/consumers.
>
> I understand why JBossMQ wants to push over bulk messages to
> consumers, but
> that is only really useful in some applications. In my case,
> I would rather
> that it pushed over smallers chunks (or even 1 msg at a time)
> to clients so
> that I could utilize the cluster of machines that I have to
> distribute the
> processing load.
>
> So, to the JBossMQ folks, does this sound like it would be easy to
> implement? Do you have any suggestions on how it might be
> done (quick fix
> and full blown god JMS provider version)? I am willing to
> look into this
> more, but I could use some pointers on which bits need to be tweaked.
>
> Any ideas?
>
> --jason
>
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
>
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development