|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ESQL Infinite Loop - 5000 MQ messages |
« View previous topic :: View next topic » |
Author |
Message
|
tank_n_spank |
Posted: Fri Sep 26, 2014 5:26 am Post subject: ESQL Infinite Loop - 5000 MQ messages |
|
|
Apprentice
Joined: 02 Sep 2014 Posts: 37
|
Hello,
So I have DFDL, an ESQL compute node which transforms the data into XML and then sends it to a Queue, however, I hit an infinite loop, can someone tell me what I've done wrong, and how can I optimize it?
Code: |
SET OutputRoot.DFDL.*:MyDFDLMessage.*:body= InputBody.*:MyDFDLMessage.*:body;
DECLARE refInput REFERENCE TO InputBody.*:MyDFDLMessage.*:body;
DECLARE refElem REFERENCE TO InputBody.*:MyDFDLMessage.*:body;
WHILE LASTMOVE(refElem) DO
SET OutputRoot.XMLNSC.MyDFDLMessage.*:body = refInput;
PROPAGATE TO TERMINAL 'out' ENVIRONMENT OutputLocalEnvironment;
-- MOVE refElem NEXTSIBLING REPEAT NAME;
END WHILE;
RETURN FALSE;
END; |
|
|
Back to top |
|
 |
mqjeff |
Posted: Fri Sep 26, 2014 5:29 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Is that MOVE statement actually commented out in the real code that you actually deploy?
If so, there's your problem. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Sep 26, 2014 5:34 am Post subject: Re: ESQL Infinite Loop - 5000 MQ messages |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
tank_n_spank wrote: |
Hello,
So I have DFDL, an ESQL compute node which transforms the data into XML and then sends it to a Queue, however, I hit an infinite loop, can someone tell me what I've done wrong, and how can I optimize it?
Code: |
SET OutputRoot.DFDL.*:MyDFDLMessage.*:body= InputBody.*:MyDFDLMessage.*:body;
DECLARE refInput REFERENCE TO InputBody.*:MyDFDLMessage.*:body;
DECLARE refElem REFERENCE TO InputBody.*:MyDFDLMessage.*:body;
WHILE LASTMOVE(refElem) DO
SET OutputRoot.XMLNSC.MyDFDLMessage.*:body = refInput;
PROPAGATE TO TERMINAL 'out' ENVIRONMENT OutputLocalEnvironment;
-- MOVE refElem NEXTSIBLING REPEAT NAME;
END WHILE;
RETURN FALSE;
END; |
|
Well, at first glance:
- the MOVE statement is commented out, so LASTMOVE will always test true and you'll loop inifinately
- you're setting the output message from refInput, so even if you were moving refElem you'd get as many output messages containing refInput as there were siblings for refElem to find
- neither refElem nor refInput seem to point to lists so I don't see how you could MOVE down *:body assuming you have multiple *:body elements in the message
Aside from that, it's quite good  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Sep 26, 2014 5:59 am Post subject: Re: ESQL Infinite Loop - 5000 MQ messages |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
tank_n_spank wrote: |
Hello,
Code: |
SET OutputRoot.DFDL.*:MyDFDLMessage.*:body= InputBody.*:MyDFDLMessage.*:body;
|
and
Code: |
SET OutputRoot.XMLNSC.MyDFDLMessage.*:body = refInput;
|
|
does your output message tree look right with
OutputRoot.DFDL
and
OutputRoot.XMLNSC
parsers?
do you really need both? _________________ 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 |
|
 |
tank_n_spank |
Posted: Mon Sep 29, 2014 12:43 am Post subject: Re: ESQL Infinite Loop - 5000 MQ messages |
|
|
Apprentice
Joined: 02 Sep 2014 Posts: 37
|
Vitor wrote: |
tank_n_spank wrote: |
Hello,
So I have DFDL, an ESQL compute node which transforms the data into XML and then sends it to a Queue, however, I hit an infinite loop, can someone tell me what I've done wrong, and how can I optimize it?
|
Well, at first glance:
- the MOVE statement is commented out, so LASTMOVE will always test true and you'll loop inifinately
- you're setting the output message from refInput, so even if you were moving refElem you'd get as many output messages containing refInput as there were siblings for refElem to find
- neither refElem nor refInput seem to point to lists so I don't see how you could MOVE down *:body assuming you have multiple *:body elements in the message
Aside from that, it's quite good  |
Quote: |
Is that MOVE statement actually commented out in the real code that you actually deploy?
If so, there's your problem. |
Thank you for the help. Commenting MOVE refElem was indeed the problem for the infinite loop. So that fixed it.
Quote: |
.does your output message tree look right with
OutputRoot.DFDL
and
OutputRoot.XMLNSC
parsers?
do you really need both |
Commenting out OutputRoot.DFDL was indeed not needed. It just passed my message and whatever raw value it first contained.
So after the changes, I got 1 message in the right format. Well, thank you guys for the help!  |
|
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
|
|
|
|