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 IndexWebSphere Message Broker SupportConnecting to TCPservers dynamically

Post new topicReply to topic
Connecting to TCPservers dynamically View previous topic :: View next topic
Author Message
arunprasa
PostPosted: Tue Nov 28, 2017 2:40 am Post subject: Connecting to TCPservers dynamically Reply with quote

Newbie

Joined: 08 Mar 2011
Posts: 4

I am unable to override the TCP Hostname and Port dynamically as our requirement is to hit different TCPIP Servers whose IP Address where read from Database based on the input message.

I am trying to override the value like

Code:

SET OutputLocalEnvironment.Destination.TCPIP.Output.Hostname = ipAddress;
SET OutputLocalEnvironment.Destination.TCPIP.Output.Port = portNumber;


where ipAddress & portNumber where retrieved from the database based on the input message country code.

Please help me
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Nov 28, 2017 6:11 am Post subject: Re: Connecting to TCPservers dynamically Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24648
Location: Ohio, USA

arunprasa wrote:
Please help me


What happens when you try it? "Unable to" doesn't give us a lot to work with.

The obvious question is are you certain you've set the Compute node to pass the LocalEnvironment (containing your new values) forward as well as the Message? It's not the default behavior.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
arunprasa
PostPosted: Wed Nov 29, 2017 1:04 am Post subject: Reply with quote

Newbie

Joined: 08 Mar 2011
Posts: 4

Thanks Vitor for the reply.

I am setting the new value which is retrieved from the Database based on my input message and try to pass them in the OutputLocalEnvironment only and also I am sure I am setting the Compute Mode as LocalEnvironment & Message.

What happens is it always takes a default value which is set at the flow level i.e I have promoted the Connections Details and the timeout of TCPIPClientOutput node and the TCPIPClientReceive node

Please find the code snippet for reference :

Code:

-- Setting Local Environment Variable
DECLARE ipAddress CHARACTER;
DECLARE portNumber INTEGER;
SET ipAddress = CacheDBLookup.DestinationData.COUNTRY_IP;
SET portNumber = CacheDBLookup.DestinationData.COUNTRY_PORT;

SET OutputLocalEnvironment.WrittenDestination.TCPIP.Output.ConnectionDetails.Hostname = ipAddress;
SET OutputLocalEnvironment.WrittenDestination.TCPIP.Output.ConnectionDetails.Port = portNumber;


Please help
Back to top
View user's profile Send private message
timber
PostPosted: Wed Nov 29, 2017 4:16 am Post subject: Reply with quote

Shaman

Joined: 25 Aug 2015
Posts: 704

Next step is to prove (to us) that the LocalEnvironment settings really are getting propagated. Best way to do that is to use a Trace node.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Nov 29, 2017 6:35 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24648
Location: Ohio, USA

arunprasa wrote:
Please help


You need to help us by being consistent. Your original post had this

Code:

SET OutputLocalEnvironment.Destination.TCPIP.Output.Hostname = ipAddress;
SET OutputLocalEnvironment.Destination.TCPIP.Output.Port = portNumber;


which is correct and leads us to the suspicion you're not passing the LocalEnvironment.

You then confirm you're passing LocalEnvironment but post this:

Code:

SET OutputLocalEnvironment.WrittenDestination.TCPIP.Output.ConnectionDetails.Hostname = ipAddress;
SET OutputLocalEnvironment.WrittenDestination.TCPIP.Output.ConnectionDetails.Port = portNumber;


which is incorrect (WrittenDestination is the actual destination used & is output by the TCP node, Destination is the desired destination & is input to the TCP node). So this second code snippet won't work even if the Compute mode is set correctly.

So to help you:

- set the Compute mode correctly
- code the ESQL correctly
- post again once you've done that if you're still having trouble and include (as my worthy associate states) the output from a Trace node that shows the override details in the correct place, in the LocalEnvironment tree and a user trace showing them being passed to the TCP node and the node then using the default ones in it's connection.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
arunprasa
PostPosted: Mon Dec 04, 2017 2:22 am Post subject: Update Reply with quote

Newbie

Joined: 08 Mar 2011
Posts: 4

Apologies for the late reply, as I am not available last week.

As advised, I have added a trace node to check the value being set in the local environment, but I can still see the value we pass at the flow level is being taken and not the one which I am extracting from database.

Code:
 My Database Contains as follows (Ip Address and PortNumber)
COUNTRY_ISO   COUNTRY_IP   COUNTRY_PORT   COUNTRY_NAME
UG                   10.250.52.90   8774            UGANDA


Please find the trace logs generated while executing :


['MQROOT' : 0x228b46b0]
(0x01000000:Name):WrittenDestination = (
(0x01000000:Name):TCPIP = (
(0x01000000:Name):Output = (
(0x01000000:Name):ConnectionDetails = (
(0x03000000:NameValue):Type = 'Client' (CHARACTER)
(0x03000000:NameValue):Hostname = '10.250.52.86' (CHARACTER)
(0x03000000:NameValue):Port = 8774 (INTEGER)
(0x03000000:NameValue):Id = '793289:16007d8239d:-7fee' (CHARACTER)
(0x03000000:NameValue):ReplyId = NULL
(0x03000000:NameValue):OpenTimestamp = TIMESTAMP '2017-12-04 12:17:25.995' (TIMESTAMP)
(0x03000000:NameValue):CloseTimestamp = NULL
(0x01000000:Name ):SequenceNumber = (
(0x03000000:NameValue):InputRecord = 0 (INTEGER)
(0x03000000:NameValue):OutputRecord = 1 (INTEGER)



['MQROOT' : 0x228b2770]
(0x01000000:Name):TCPIP = (
(0x01000000:Name):Receive = (
(0x01000000:Name):ConnectionDetails = (
(0x03000000:NameValue):Type = 'Client' (CHARACTER)
(0x03000000:NameValue):Hostname = '10.250.52.86' (CHARACTER)
(0x03000000:NameValue):Port = 8774 (INTEGER)
(0x03000000:NameValue):Id = '793289:16007d8239d:-7fee' (CHARACTER)
(0x03000000:NameValue):ReplyId = NULL
(0x03000000:NameValue):OpenTimestamp = TIMESTAMP '2017-12-04 12:17:25.995' (TIMESTAMP)
(0x03000000:NameValue):CloseTimestamp = NULL
(0x01000000:Name ):SequenceNumber = (
(0x03000000:NameValue):InputRecord = 1 (INTEGER)
(0x03000000:NameValue):OutputRecord = 1 (INTEGER)
)


To summarise, the value I am setting in LocalEnvironment is not being taken and it always taking the value we set at the flow level (10.250.52.86:8774) and not from database (10.250.52.90:8774)

Thanks.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 04, 2017 6:02 am Post subject: Re: Update Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24648
Location: Ohio, USA

arunprasa wrote:
To summarise, the value I am setting in LocalEnvironment


Setting in the wrong place. See my comments above.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
arunprasa
PostPosted: Tue Dec 05, 2017 12:13 am Post subject: Reply with quote

Newbie

Joined: 08 Mar 2011
Posts: 4

The issue is now resolved and now I can pass the TCPIPClientOutput Nodes (ConnectionDetails & Timeout Value) dynamically and it is taking the values which is extracted from the database based on the CountryISO in the input request XML.

Thanks to All for your guidance & Support in resolving this issue.

Resolution : As advised by Vitor I have set the OutputLocalEnvironment as follows and also changed the Compute Mode properties to consider both LocalEnvironment and Message

Code:

SET OutputLocalEnvironment.Destination.TCPIP.Output.Hostname = ipAddress;
SET OutputLocalEnvironment.Destination.TCPIP.Output.Port = portNumber;


Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportConnecting to TCPservers dynamically
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.