ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » ESQL Infinite Loop - 5000 MQ messages

Post new topic  Reply to topic
 ESQL Infinite Loop - 5000 MQ messages « View previous topic :: View next topic » 
Author Message
tank_n_spank
PostPosted: Fri Sep 26, 2014 5:26 am    Post subject: ESQL Infinite Loop - 5000 MQ messages Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Fri Sep 26, 2014 5:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Sep 26, 2014 5:34 am    Post subject: Re: ESQL Infinite Loop - 5000 MQ messages Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Fri Sep 26, 2014 5:59 am    Post subject: Re: ESQL Infinite Loop - 5000 MQ messages Reply with quote

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
View user's profile Send private message
tank_n_spank
PostPosted: Mon Sep 29, 2014 12:43 am    Post subject: Re: ESQL Infinite Loop - 5000 MQ messages Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » ESQL Infinite Loop - 5000 MQ messages
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.