Author |
Message
|
gappodi |
Posted: Thu Nov 29, 2018 8:58 am Post subject: Override configurable property dynamicaly |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
I am writing a message flow in which I need to use an HTTPRequest node in order to send requests to multiple webservice hosts. The input message to my flow will have a flag based on which I will choose which host to redirect to.
Is there a way I can dynamically override the configurable properties like URLSpecifier and KeyAlias while the flow executes ? I understand I can override these properties using 'mqsiapplybaroverride' command. But that would leave me setting it to one fixed value.
I guess I might have to write additional code but I am not sure what that would be. Can someone please provide inputs here ?
Thanks and Regards,
Maneesh Sharma |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 29, 2018 9:34 am Post subject: Re: Override configurable property dynamicaly |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
gappodi wrote: |
I guess I might have to write additional code but I am not sure what that would be. Can someone please provide inputs here ? |
You need to set the values you want the node to use in the correct part of the LocalEnvironment tree (and make sure the LocalEnvironment is passed to the HTTPRequest node). See here. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gappodi |
Posted: Thu Nov 29, 2018 9:41 am Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
Thanks Vitor. So I can do this via a Compute node right prior to HTTPRequest node and have the logic inside it which host is to be redirected. Is that correct ? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 29, 2018 9:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
gappodi wrote: |
Thanks Vitor. So I can do this via a Compute node right prior to HTTPRequest node and have the logic inside it which host is to be redirected. Is that correct ? |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gappodi |
Posted: Thu Nov 29, 2018 9:43 am Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
Thank you so much for your guidance  |
|
Back to top |
|
 |
gappodi |
Posted: Fri Nov 30, 2018 5:51 am Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
Hi Vitor,
I tried something like following in an ESQL Compute node..
SET OutputLocalEnvironment.Destination.HTTP.RequestURL=https://ibm.com/abc
But it still takes the URL mentioned in the HTTPRequest node under 'WebService URL' property in the message flow.
Am I missing anything in my ESQL Compute node ? |
|
Back to top |
|
 |
Vitor |
Posted: Fri Nov 30, 2018 6:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
gappodi wrote: |
Am I missing anything in my ESQL Compute node ? |
Vitor wrote: |
(and make sure the LocalEnvironment is passed to the HTTPRequest node) |
It's not passed by default - you have to change the Compute node properties.
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gappodi |
Posted: Fri Nov 30, 2018 7:27 am Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
Can you please tell which is that property in the compute node I should set to get it passed to the HTTPRequest node ?
Regards,
Maneesh Sharma |
|
Back to top |
|
 |
Vitor |
Posted: Fri Nov 30, 2018 7:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
gappodi wrote: |
Can you please tell which is that property in the compute node I should set to get it passed to the HTTPRequest node ? |
Seriously?
If you look at the properties, you can discount "Data Source", "Connect before flow starts", "ESQL Module", "Treat warnings as errors" and "Throw exceptions on database error" as clearly not connected with this.
"Transaction mode" might be a possibility, but the 2 options of "Automatic" and "Commit" in the drop down don't seem likely.
So you're left with "Compute Mode". The drop down for which has a number of options including a number which include "Local Environment"
But you didn't bother to look, did you?
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gappodi |
Posted: Fri Nov 30, 2018 7:55 am Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
Ohh.. I am sorry I really missed it. Did not realize that Compute mode was a dropdown with what you told earlier. Thanks for pointing it out !
Regards,
Maneesh Sharma |
|
Back to top |
|
 |
gappodi |
Posted: Mon Dec 03, 2018 11:25 pm Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
Thanks you Vitor. It worked now ! I am just wondering if I can do it by using a JCN as well ? Can you please help here ? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 04, 2018 5:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gappodi wrote: |
Thanks you Vitor. It worked now ! I am just wondering if I can do it by using a JCN as well ? Can you please help here ? |
I'd be surprised if you could not.
Just make sure your propagate statement transfers the right things.
Check how you create the outAssembly...
And remember to copy the LocalEnvironment tree from the in Assembly to the outAssembly...
Have fun  _________________ MQ & Broker admin
Last edited by fjb_saper on Tue Dec 04, 2018 5:35 am; edited 1 time in total |
|
Back to top |
|
 |
gappodi |
Posted: Tue Dec 04, 2018 5:30 am Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
Thanks Vitor. I obtained the local environment in my code and with the help of an XPath, I am now able to achieve the same via JCN.
Regards,
Maneesh Sharma |
|
Back to top |
|
 |
gappodi |
Posted: Tue Dec 04, 2018 9:42 am Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
|
Back to top |
|
 |
gappodi |
Posted: Tue Dec 04, 2018 11:58 pm Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
Does these overridden values remain in the environment tree until message flow completes ? For e.g. if I have a subsequent second HTTPRequest node in my message flow and I do not want these values to be carried forward to this node, Should I clear my local environment tree before the second HTTPRequest node is invoked in the message flow ? Please provide your inputs on it.
Thanks and Regards,
Maneesh Sharma |
|
Back to top |
|
 |
|