activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Input queue and output queue grouping and sequences question
Date Wed, 11 Apr 2007 18:30:17 GMT
On 4/10/07, tnine <> wrote:
> Hi All,
>   I'll be writing a process that uses parallel grid processing to process
> message groups.  I'm new to Active MQ and could use some help in finding
> documentation or examples.
> I'll be running in the following environment
> Java 1.6
> JBoss 4
> Active MQ 4.1.1
> I know I will be performing the following operations.
> 1. Create a text message with the following format.  [company-name]-[ISO
> Date]
> 2. Push all text messages into this group
> 3. When I'm done producing all of the messages, I'll perform the
> message.setIntProperty("JMSXGroupSeq", 0); to close the group.
> I have have the following questions.
> Producer/Consumer
> 1. Is it possible to insert multiple messages into the queue in a single XA
> transaction?

Yes - whether using JMS or XA transactions, you can send or receive
multiple messages; its up to you when you do the commit

>  If so is there an example?  Since the input is a large flat
> file, I want either all messages to be inserted or none.

How large is the file?

> 2. Is there a way for me to detect on the MDB side when the last message is
> sent? Can I simply perform the message.getIntProperty("JMSXGroupSeq") and
> search for the value 0 to find the last message?

Sure. Or just add your own header to indicate the last message if you prefer

> 3. I have 2 queues, one input queue, and one output queue.  Both queues need
> to be processed in the exact same order.  As the MDB reads from the input
> queue, can I put the same JMSXGroupSeq number into the output queue message
> and still have the same ordering semantics without screwing up the Group
> processing in Active MQ?

The 2 queues are processed separately by different consumer groups;
but sure order would be guarrenteed if you use the same JMSGroupID

> Monitoring
> I want to write a simple webapp that shows the percentage of message in the
> queues.  Is it possible to read the groups, and for each group show the
> messages on the queue?

Not efficiently; you could write your own Interceptor to do just that

but you could inefficiently do it by just browsing the queue via the
QueueBrowser on JMS to figure out the numbers etc



View raw message