Author |
Message
|
AskMe |
Posted: Thu Sep 15, 2011 3:29 am Post subject: Fetch all messages from Mq Queue |
|
|
Newbie
Joined: 15 Sep 2011 Posts: 2
|
Hi All,
I have to fetch all messages from Queue available and send an email having all messages and this should happen daily. how to achive this scenario. Currently in my scenario i am using timeoutcontrol node and timeout notification node but what is happening is only one message is picked up daily remaining mesages wait for next trigger which happen next day |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Thu Sep 15, 2011 4:07 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
You have to create loop around the MQGet -node. If you have huge amount of messages in the waiting q beware of that you don't exceed your memory resources.
--
Marko |
|
Back to top |
|
 |
AskMe |
Posted: Thu Sep 15, 2011 4:26 am Post subject: |
|
|
Newbie
Joined: 15 Sep 2011 Posts: 2
|
but i guess we can get messages using MQGET node if we know the messageid..or correlid..But in my case i want to get all message collate then and send them in an email. I dont know the message id or correlid |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Sep 15, 2011 4:30 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
marko.pitkanen |
Posted: Thu Sep 15, 2011 4:35 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 15, 2011 7:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
AskMe wrote: |
But in my case i want to get all message collate then and send them in an email. I dont know the message id or correlid |
Then use MQInput not MQGet. This will read all the messages from the queue (without the memory problems associated with an MQGet in a loop). You can then collect them into an email and send it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
geewee |
Posted: Mon Nov 05, 2012 4:41 am Post subject: |
|
|
Apprentice
Joined: 31 Jul 2012 Posts: 28
|
How to control the timing for get messages from the queue.
Using MQInput will get messages of queue as they are available, but the retrieval of messages should only happen every third hour.
Looping MQGet give EXCEPTION_STACK_OVERFLOW.
Could we configure MQGet to retrieve all available messages on queue,
by using MQCI_NONE or similar.
Not getting by msgid, not getting by correlId, none configured as request filter. |
|
Back to top |
|
 |
zpat |
Posted: Mon Nov 05, 2012 4:53 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
As I said elsewhere, to repeatedly use MQGET in a message flow (without a stack overflow) - use the ESQL propagate statement to execute another branch of the flow with the MQGET node on it.
Loop in the ESQL code and not in the flow control. |
|
Back to top |
|
 |
geewee |
Posted: Mon Nov 05, 2012 5:01 am Post subject: |
|
|
Apprentice
Joined: 31 Jul 2012 Posts: 28
|
thanks
use the ESQL propagate statement to execute another branch of the flow with the MQGET node on it.
could you give links, coding hints on this? |
|
Back to top |
|
 |
zpat |
Posted: Mon Nov 05, 2012 5:11 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
It's a bit hard to draw a diagram here.
The loop is in a compute node's ESQL code, until end of queue. Inside the loop is a propagate statement to a terminal (e.g. out2).
The out2 terminal is connected to a MQGET node.
The MQGET is connected to another compute node that stores the message in the environment area (which the ESQL loop can access).
The MQGET no message terminal is connected to another compute node that signals the end of the loop by setting an environment variable (that the ESQL loop checks). |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Mon Nov 05, 2012 6:44 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
Perhaps you could find out what you can do with MQInput and Collector node in "Collect messages for a set period" scenario.
--
Marko |
|
Back to top |
|
 |
|