Author |
Message
|
andy1989 |
Posted: Wed Apr 03, 2013 5:02 am Post subject: Environment variables and MQOutput/Input |
|
|
Novice
Joined: 07 Jan 2013 Posts: 22
|
Hello,
My IBM WS MB: 7.0.0.2
I have the problem similar to http://www.mqseries.net/phpBB/viewtopic.php?p=227269&sid=f4630cc31feb22b29531ebbc25724b96
I have to set the destination dynamically (with Environment.Variables ) and it works fine for below flow:
InputNode --> ComputeNode --> SOAPRequest --> OutputNode,
[Compute Node has Compute Node set to 'All']
But I have to put the Queue before my SOAPRequest:
InputNode --> ComputeNode --> MQOutput
and
MQInput --> ComputeNode --> SOAPRequest -->OutputNode
[for both Compute nodes - compute mode is set to 'All']
Unfortunately my Environments and LocalEnvironments variables disappeared after MQInput node.
( Logger with ${Environment} after my MQInput is empty )
Message flows are in the same execution group.
Is there any additional option for MQ to enable usage of Environment variables?
Andy |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Apr 03, 2013 5:13 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
In Compute node Properties->Compute Mode, you must select "LocalEnvironment and Message" and also in your ESQL code, assign OutputLocalEnvironment.
The InfoCentre provides a wealth of information in this area. Training provides personal guidance, if you have difficulty understanding the documentation in the InfoCentre. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
andy1989 |
Posted: Wed Apr 03, 2013 5:45 am Post subject: |
|
|
Novice
Joined: 07 Jan 2013 Posts: 22
|
But what is the difference between my 2 solution?
I put the trace nodes 'before' and 'after' queue:
Input --> Trace1 --> MQOutput
MQIput --> Trace2 --> Output
and in Trace1 there are both LocalEnvironment and Environment variables but in Trace2 there aren't.
Andy |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Apr 03, 2013 5:48 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
The Envoronment.* tree is NOT subject to any of the Compute node options. An Environment tree is created at the InputNode (where the flow starts working) and remains with it until the thread has ended.
If you put put a TraceNode right after the MQInput Node 'out' termnial and code it to display
${Environment}
It won't show very much. Well, nothing actually because you have not used it.
Try saving something into it before displaying it with a trace node. you might be pleasantly surprised by what you see.
As the previous post indicates some formal training will help you understand what is going on as well as allowing you to try all sorts of things out in a nice safe environment (pun intended) _________________ 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 |
|
 |
andy1989 |
Posted: Wed Apr 03, 2013 6:24 am Post subject: |
|
|
Novice
Joined: 07 Jan 2013 Posts: 22
|
Quote: |
In Compute node Properties->Compute Mode, you must select "LocalEnvironment and Message" and also in your ESQL code, assign OutputLocalEnvironment. |
I've changed my flow after your suggestion:
Environment --> LocalEnvironment
Compute mode "All" --> "LocalEnvironment and Message"
Unfortnately result the same:
Trace1:
Code: |
LocalEnvironment:
( ['MQROOT' : 0x115729ab0]
(0x01000000:Name):Variables = (
(0x03000000:NameValue):Operation = 'myOperation' (CHARACTER)
)
) |
Trace2:
LocalEnvironment:
[empty] |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Apr 03, 2013 6:28 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
LocalEnvironment/Environment does not flow through queues, unless you explicitly code LocalEnvironment into your payload then decode it into the LE on the second flow.
This is basic information. Please read the InfoCentre. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mgk |
Posted: Wed Apr 03, 2013 6:30 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
That's because the Environment and LocalEnvironment trees are specific to a single instance of a flow, and are not shared between the two threads running in your case. If you want to pass data from one to the other you need to use a SHARED variable, the V8 the global cache or something similar.
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
andy1989 |
Posted: Thu Apr 04, 2013 4:11 am Post subject: |
|
|
Novice
Joined: 07 Jan 2013 Posts: 22
|
Thank you for your tips,
I will try to reorganize my message structure.
Andy |
|
Back to top |
|
 |
|