|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Browse and Get Message From Q |
« View previous topic :: View next topic » |
Author |
Message
|
meriton |
Posted: Thu Apr 10, 2003 4:04 pm Post subject: Browse and Get Message From Q |
|
|
Novice
Joined: 07 Aug 2002 Posts: 24
|
Hi All,
Currently we have java program which is used to get message from Q and create a Falt file.
Here is how it works.
We have two MQ queues,control queue and a data queue.Actual messages for a batch are sent to Data Q, and a SINGLE control message for that batch is sent to Control Queue.
Control message contains batch information such as Batch Id,Correlation ID,No of Data message in the batch .
There is a MQ trigger which triggered(which runs the Java program)when a Control Message is arrived.
Follows the work flow of Java program.
Browse Control queue,get Bach specifi info mentioned above.
Browse Data queue and search for the batch using Batch Id ,Correlation Id and set up a counter for number of data message found for the batch.
If the number of data message found is same as the No. of data message flag in Control message do a destructive Get and put it in a flat file.
ISSUE
The java program works reasonably well,we would like to optimise the code due to the following problem.
Control message and data message sent to queues can not be guaranteed to be in the same order.
For example :
In the control queue there are two messages Batch2 ctl message and then Batch1 Ctrl message.
In the Data Q . data message(can be in 100's of thousand) for Batch1 appears before data message for Btach2.
When the java programs runs it first trying to locate Data message for Batch2(becuase Ctrl message for Batch2 appears first) and browse the Data queue.The program has to browse through data message for Batch1(can be thousands) before getting near the data message for Batch2.
This makes the program very slow, even slower if there are few more large batches in the data message.
I need suggestion how to resolve this issue.
Thanks |
|
Back to top |
|
 |
meekings |
Posted: Fri Apr 11, 2003 5:20 am Post subject: |
|
|
 Voyager
Joined: 28 Jun 2001 Posts: 86 Location: UK, South West
|
How about using one queue only, and setting your trigger for, say, priority 2 messages. Then send your data messages as priority 1, and control message as priority 2.
Or forget control messages altogether, and send all data messages as a group - your receiving app can set an option to wait for all messages in the group to arrive before reading. _________________ Brian Meekings
Information Design, Inc. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|