|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Using MQGet to empty the queue - STACK OVERFLOW |
« View previous topic :: View next topic » |
Author |
Message
|
smdavies99 |
Posted: Tue Feb 03, 2009 10:40 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
[quote="Esa"]
But if you loop in a compute node or a java compute node and call the MQGet node from within that loop by propagating some message, the call will return back to the compute node after each message read from the MQGet queue. And, as you can read from between the lines of mgks post, the memory allocated for each message is released immediately after it has been handled.
Well, actually the memory is not released to the operating system but some MB internal memory buffer where it is - hopefully - immedially availabe for other message flow threads. What I was not sure about was if any memory allocated by nodes could be released while the thread is still running or only after it has terminated.[/quote]
That is the exact reason for my suggestion that the flow sending a message to itself to continue its work and then ending its current UOW after the 'loop' of MQGet, Compute has been executed a number of times.
This is the principle I use on a flow that has to retrieve 10,000 messages from a DB and send them for processing. Conservation of resources. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
francoisvdm |
Posted: Wed Feb 04, 2009 1:17 am Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
If you really HAVE to do this...here is how to do it:
In a compute node have the following code:
Code: |
SET LoopMe = 1;
WHILE LoopMe = 1 DO
PROPAGATE TO TERMINAL 'out';
END WHILE;
RETURN FALSE; |
Following the compute node insert the MQGet node.
Connect the "Out" terminal of the MQGet node to nothing...or something if you want to.
Connect all other nodes of the MQGet node to a Compute node with the following code
Code: |
SET LoopMe = 0;
RETURN TRUE; |
An das a global have
Code: |
DECLARE LoopMe SHARED INTEGER; |
Ugly...but it works _________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
shalabh1976 |
Posted: Wed Feb 04, 2009 2:53 am Post subject: [SOLVED]Using MQGet to empty the queue - STACK OVERFLOW |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Hi all,
Use of Propagate has solved the problem. Obviously the looping on the MQGet has also been removed. _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|