|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to handle large number of messages ? |
« View previous topic :: View next topic » |
Author |
Message
|
Priya |
Posted: Mon Mar 25, 2002 9:15 am Post subject: |
|
|
Apprentice
Joined: 20 Mar 2002 Posts: 26
|
Hi,
The long running program gets the message from the queue on FIFO basis, process it and put the reply back in to another queue. Once this is done the loop has to be there to wait for another message indefinitely (unlimited wait) to get another message and do the same.
In this case if large number of message arrives then processing will not be fast enough if one instance of the application is running.
How to handle this?
please advise me and help me out....
Thanks
|
|
Back to top |
|
 |
mqonnet |
Posted: Mon Mar 25, 2002 9:28 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
There could be many ways to get around this one. But using only one instance of the program it might be a little difficult to overcome this bottleneck. Reason. You have to issue an MQGET call anyways, to get a message. So, you shall be ending up issuing this call as many times as there are messages. A few ways...
You could make your program multi-threaded, so that you can process more messages. This, only if you dont want to go with the option of more than one instance of the program.
Triggering is another alternative. Use trigger depth to trigger another instance of this program if there are more than a specified number of messages on queue.
Events. You could enable queue events, so that when the queue is full you set up a mechanism to start another instance of the same program.
Hope this helps.
Cheers.
Kumar
_________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
Back to top |
|
 |
Priya |
Posted: Mon Mar 25, 2002 10:29 am Post subject: |
|
|
Apprentice
Joined: 20 Mar 2002 Posts: 26
|
Thanks for your response.
(1) How do I make the program multi threaded?
(2) If I use trigger depth, for the first time, the program will not be started until the number of message messages reaches the limit. Once it is triggered, the program gets the message until the queue is empty, mean time if the number of message reaches the limit and again another instance of the same program starts then both will try to get the same message from the queue. How to handle this?
Please advice me If I am wrong?
|
|
Back to top |
|
 |
mqonnet |
Posted: Mon Mar 25, 2002 10:43 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
(1) How do I make the program multi threaded?
Depending upon the platform you have to design your app accordingly. You need to look in the respective platform manuals to see what api calls you need to use and probably there would some sample programs for the same. Like in MSDN you shall find help relating to Windows platforms.
(2) If I use trigger depth, for the first time, the program will not be started until the number of message messages reaches the limit. Once it is triggered, the program gets the message until the queue is empty, mean time if the number of message reaches the limit and again another instance of the same program starts then both will try to get the same message from the queue. How to handle this?
If you think that many instances of the program might prop up as a result of delayed processing, you might want to terminate the application after it has processed certain number of messages. So that you dont have many such instances of the same app. As for two or more apps trying to read the same message is concerned, you need to Get the message in your program to retrieve any message. Not any specific message with msgid or correlid. This way all the instances would retrieve differnt messages without any problem.
Cheers.
Kumar
_________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
Back to top |
|
 |
Priya |
Posted: Mon Mar 25, 2002 11:23 am Post subject: |
|
|
Apprentice
Joined: 20 Mar 2002 Posts: 26
|
I am developing the program in AIX.
In the second case, If the number of message in the queue does not reach the limit, how the program will be started for the first time? So the messages will not get processed until it reaches the limit. Is that good design to go for triggering? I am in the process of designing the MQSeries Application. Please advice me the better way.
Thanks |
|
Back to top |
|
 |
mqonnet |
Posted: Mon Mar 25, 2002 11:44 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
I am developing the program in AIX.
--Please refer to the api's within aix and the samples, if any, to see how you can write a threaded app.
In the second case, If the number of message in the queue does not reach the limit, how the program will be started for the first time? So the messages will not get processed until it reaches the limit. Is that good design to go for triggering? I am in the process of designing the MQSeries Application. Please advice me the better way.
--- "Better way" is all dependent on your requirement and hence the design(which you only have to arrive at, eventually). As for triggering of app is concerned, the window of performance bottleneck is very small and it depends on the depth you set to. If you set it to say 1000, it sure is not the right approach. As suggested earlier, you could have a small depth. App gets triggered. Let the app process certain number of messages and when there are no more messages to process, let it terminate. And the loop continues after a new message arriving on the queue.
Cheers.
Kumar
_________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
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
|
|
|
|