-
1. Re: Multiply queue consumers
blackers Jun 11, 2003 5:28 AM (in response to magnusw)I am by no means an expert on JMS, but this sounds to me as though you need to use Topics, not Queues. Queues are Point-To-Point and Topics are Point-To-MultiPoint
Mat -
2. Re: Multiply queue consumers
magnusw Jun 11, 2003 5:52 AM (in response to magnusw)Not reallly,
a Topic deliver the message to all consumers.
I only wan't the message to be delivered to one consumer but not the same one everytime to get an even load on the consumers.
I've used a few other JMS servers like Fiorano and OpenJMS and they use a round robin way when having multiply consumers on a queue but it seams like JBoss doesn't. -
3. Re: Multiply queue consumers
weiqingh Jun 11, 2003 10:06 AM (in response to magnusw)multiple queue receiver semantics is not defined by JMS. (jms spec section 4.4.9). it's up to jms provider to decide what to do. so you shouldn't count on it.
i am not sure why you need the round-robin behavior. what is the beneifit you are trying to get? if it's load balancing, maybe you can use ejb instead -- having one consumer receiving messages and invoke a clusered SLSB that will process the message.
or you can use a topic and create multiple MDBs. i am not sure if you would get a round-robin among those MDBs. you can also look into MessageConsumer to see if you can do your own distribution.
another idea is that if the number of receivers is known, you can have multiple topic subscribers each having a selector (based on its id or something). and then your publisher has to create a message such that each time the message will be selected by only one consumer. it's certainly not elegant... -
4. Re: Multiply queue consumers
celticprince Sep 22, 2004 3:18 PM (in response to magnusw)I am successfully doing what you are trying. I have multiple message consumers running in client processes. Each of them connect to the same queue, though they each have their own connection, session, queueReceiver, etc. I use a message listener for each, and the process messages in a truly asynchronous manner. I am using JBoss 3.2.3. It works with JBoss 3.2.5 and Weblogic 7.x and 8.x as well.
Each of my clients are also running in different JVMs (a requirement for what I do with the messages). -
5. Re: Multiply queue consumers
piperclub Feb 3, 2005 1:40 AM (in response to magnusw)when i try having multiple consumers on a queue, and say you send a flood of 1000 messages. Most of them go to one consumer, less than 1% of the messages hit the second consumer.
is there a setting somewhere that allows us to balance the load between the consumers available? -
6. Re: Multiply queue consumers
adrian.brock Feb 4, 2005 10:19 PM (in response to magnusw)Moderated: RTFM
Hint: ReceiversImpl -
7. Re: Multiply queue consumers
razor_harm Feb 10, 2005 10:53 AM (in response to magnusw)"adrian@jboss.org" wrote:
Moderated: RTFM
Hint: ReceiversImpl
Just for the 'searches' on the forum....
This is actualy not in the Manual. But it can be found in the WIKI:
http://www.jboss.org/wiki/Wiki.jsp?page=JBossMQReceiverImpl -
8. Re: Multiply queue consumers
jgc195 Feb 16, 2005 12:15 PM (in response to magnusw)Sorry - I'm obviously being stupid and missing something obvious but...
If I configure my queue to use a different ReceiverImplementation, how do I configure that with x number of consumers?
For example - if I had a queue defined as<mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=myQueue"> <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends> <attribute name="ReceiversImpl"> org.jboss.mq.server.ReceiversImplArrayList </attribute> </mbean>
Where does this list of consumers go? Is it something like this:<mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=myQueue"> <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends> <attribute name="ReceiversImpl" implementation="org.jboss.mq.server.ReceiversImplArrayList"> <consumer>server1</consumer> <consumer>server2</consumer> </attribute> </mbean>
Or are they hard coded into an implementation of the Receivers interface? Of is this something to do with the DestinationManager?
Apologies in advance if this is a really really stupid question...
Jason -
9. Re: Multiply queue consumers
razor_harm Feb 17, 2005 4:47 PM (in response to magnusw)"jgc195" wrote:
Sorry - I'm obviously being stupid and missing something obvious but...
....
Or are they hard coded into an implementation of the Receivers interface? Of is this something to do with the DestinationManager?
Apologies in advance if this is a really really stupid question...
Jason
The creation of list takes place on runtime. The ReceiverImpl class (implements the Receivers interface) has a method: void add(Subscription sub); Correct me if I'm wrong, but I suspect this method gets called when the consumer registers itself onto the server. -
10. Re: Multiply queue consumers
adrian.brock Feb 18, 2005 7:53 PM (in response to magnusw)"razor_harm" wrote:
Correct me if I'm wrong, but I suspect this method gets called when the consumer registers itself onto the server.
You are not wrong. Clients make subscriptions through the normal JMS api.
This is just the implementation of the internal datastructure so you can
override behaviour like load balancing policy.