|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Propagate a message from ESQL compute node |
« View previous topic :: View next topic » |
Author |
Message
|
gappodi |
Posted: Tue Feb 24, 2015 10:41 pm Post subject: Propagate a message from ESQL compute node |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
I have a BLOB set in my environment variables. I want to set and propagate propagate this from my out terminal and it should be available as a message to the next node. I am writing the following piece of code but this does not seem to be working.
BROKER SCHEMA com.ibm.einvoicing.esql.common
CREATE COMPUTE MODULE setPrimaryDocFromVariables
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
CALL CopyEntireMessage();
SET OutputRoot.BLOB.BLOB = Environment.Variables.EInvoicing.HRInvoice;
PROPAGATE TO TERMINAL 'Out';
RETURN FALSE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
Please provide some help here. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Feb 25, 2015 1:24 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
1) Don't use BOTH of these
Code: |
CALL CopyMessageHeaders();
CALL CopyEntireMessage();
|
2) You probabl only need
Code: |
CALL CopyMessageHeaders();
|
as you are adding a BLOB to the OutputRoot.
3) This
Code: |
PROPAGATE TO TERMINAL 'Out';
RETURN FALSE;
|
Is also where you are going wrong. There is No Terminal 'Out'.
(look at the case)
4) This
Code: |
PROPAGATE TO TERMINAL 'Out';
RETURN FALSE;
|
when you fix the terminal name is the same as
_________________ 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 |
|
 |
gappodi |
Posted: Wed Feb 25, 2015 5:59 am Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
Thanks smdavies99 a lot for rectifying it. I am able to get through this now.
However, I realized, that I was using a wrong piece of code as following
Code: |
PROPAGATE TO TERMINAL 'out';
RETURN TRUE; |
I was propagating explicitly as well as returning a 'True'. I observed that this was causing NullPointerException some where down the message flow.
When I corrected it to the following piece of code, my flow executed smoothly.
Code: |
PROPAGATE TO TERMINAL 'Out';
RETURN FALSE; |
So, I was just wondering what was the problem with the faulty piece of code. Is it like if I propagate explicitly and return a TRUE, will it propagate the message twice which causes some problem down the message flow?
Kindly throw some light on it. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 25, 2015 6:10 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
gappodi wrote: |
if I propagate explicitly and return a TRUE, will it propagate the message twice |
Yes.
And you have to think about what message is being propagated the second time. |
|
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
|
|
|
|