Author |
Message
|
gecs |
Posted: Mon May 21, 2012 9:16 am Post subject: User Defined Property (UDP) vs Promote Property (PP) |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
Hi everybody, I would know if exists any form to use a Promote Property as "UDP". It happens I have declared a CONSTANT which has same value of a PP ("queue name" MQGet Node property). So, I want to eliminate the CONSTANT and use the PP value, but when I try to reference it by ESQL editor (like as UDP), it doesn't appear.
One solution could be to create a UDP and override the MQGet Node property "queue name" through LocalEnvironment, but I would like know if is possible reference PP by ESQL editor or if exists other solution (using PP).
Last questions:
- How can I reference it (the PP value)?
- PP only serves to change a BAR property?
Additional Info:
- MQ 7.0
- Message Broker 7.0
Thanks in advance! |
|
Back to top |
|
 |
Vitor |
Posted: Mon May 21, 2012 9:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
AFAIK there's no way to reference any node property within ESQL except insofar as some node expose details through LocalEnvironment.
The question comes why are you attempting to reference the queue name of the node inside ESQL? It's very anti-pattern, as if the WMQ administrator ever decides to rename the queue & correctly resets the promoted property to reflect the change your code will still be hosed. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gecs |
Posted: Mon May 21, 2012 9:59 am Post subject: |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
Vitor wrote: |
The question comes why are you attempting to reference the queue name of the node inside ESQL? |
Hi @Vitor, thanks for your reply. According to your question, I want to reference this promote property (queue name) because of I need its value in different parts of the code and this value can change according the environment where flow is deployed. Also, I don't want to use any CONSTANT which constains same value.
Regards. |
|
Back to top |
|
 |
Vitor |
Posted: Mon May 21, 2012 10:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
gecs wrote: |
I want to reference this promote property (queue name) because of I need its value in different parts of the code and this value can change according the environment where flow is deployed. |
That's exactly my point. If someone renames the queue 6 months / 1 year / 5 years down the road your code will cease to work.
If you want to identify which enivornment you're in better ways include (but are not limited to):
- a UDP (which has the advantage of allowing you to make code in any enivornment act as if it's in any other environment & is my personal favorite)
- the broker name (which typically has some part of it's name indicating the environment it belongs to) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon May 21, 2012 10:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So you need to set a User Defined Property and use the User Defined Property to Set the Destination that the MQGetNode will use to read the name of the queue to determine what queue to read from.
That is, rather than using the Promoted Property of the node, you need to use a UDP and LocalEnvironment overrides.
The only way to get at a Promoted Property, or any property of a message flow, is using the Admin API which is only available from Java. |
|
Back to top |
|
 |
Vitor |
Posted: Mon May 21, 2012 10:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
The only way to get at a Promoted Property, or any property of a message flow, is using the Admin API which is only available from Java. |
Which is a fairly heavy sledgehammer in an application flow. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon May 21, 2012 10:24 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Vitor wrote: |
mqjeff wrote: |
The only way to get at a Promoted Property, or any property of a message flow, is using the Admin API which is only available from Java. |
Which is a fairly heavy sledgehammer in an application flow. |
It's easier in v7 and v8 because you can get a proxy to the broker you're running under without having to create a new connection object and etc. etc. etc.
but it's still the long way around. |
|
Back to top |
|
 |
|