[jboss-user] [JBoss Messaging] - Re: Limiting the consumers & producers of a queue

timfox do-not-reply at jboss.com
Thu Apr 3 08:25:11 EDT 2008


The way message grouping would work is as follows:

Before you send a message you set a special header on the message - not sure what it is going to be called yet, but let's call it GROUP_ID for now.

Before JBM delivers the message to a consumer, it checks if the GROUP_ID header is present, if it is then it looks up to see if it has a consumer registered for that group id, if it has then it sends the message to that consumer, if it hasn't then it chooses a consumer, registers that consumer against that group id then sends the message to the consumer.

So you can see that all messages with a specific value of GROUP_ID will be consumed by the same consumer (even though there may be multiple consumers on the same queue).

GROUP_ID is not specified by the clients that connect.

This is more flexible than limiting consumers since you can have multiple consumers consuming off the same queue with different values of GROUP_ID.

E.g. consumer1 deals with all the GROUP_ID=REDHAT_STOCK price messages, and consumer 1 deals with all the GROUP_ID=IBM_STOCK price messages.

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

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



More information about the jboss-user mailing list