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 Index » General IBM MQ Support » Default outgoing Port number MQ Client

Post new topic  Reply to topic
 Default outgoing Port number MQ Client « View previous topic :: View next topic » 
Author Message
Remco
PostPosted: Thu Sep 25, 2003 12:41 am    Post subject: Default outgoing Port number MQ Client Reply with quote

Acolyte

Joined: 19 Mar 2002
Posts: 68
Location: Capelle aan den IJssel (Rotterdam)

Hi all....

Could someone tell me what the default outgoing portnumber is of an MQ Client. Is this the Port number mentioned in the Environment Variable or the Amqclchl.tab ???

Or is there maybe some other default port ???

Remco
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jefflowrey
PostPosted: Thu Sep 25, 2003 6:09 am    Post subject: Re: Default outgoing Port number MQ Client Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Remco wrote:
Hi all....

Could someone tell me what the default outgoing portnumber is of an MQ Client. Is this the Port number mentioned in the Environment Variable or the Amqclchl.tab ???


Which direction do you mean by 'outgoing'? The default port the client will attempt to open from itself to the server? Or the port that the server will open back to the client?

The first is the port number mentioned in the Environment variable or the client table.

I don't know the second, but it's probably documented in the Clients manual.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Remco
PostPosted: Thu Sep 25, 2003 6:54 am    Post subject: Reply with quote

Acolyte

Joined: 19 Mar 2002
Posts: 68
Location: Capelle aan den IJssel (Rotterdam)

Hi, I mean the port that is used on the client while getting messages from the server.

Hope this is clear...
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
bower5932
PostPosted: Thu Sep 25, 2003 9:51 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I think you are interested in the localaddr parameter on your channel definition. There are details in the MQSC command reference. This used to be done with the TcpSdrPort environment variable.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
mrlinux
PostPosted: Fri Sep 26, 2003 8:58 pm    Post subject: Reply with quote

Grand Master

Joined: 14 Feb 2002
Posts: 1261
Location: Detroit,MI USA

It would be based on the conname if using the CLIENT CHANNEL TABLE files
or MQSERVER=SYSTEM.DEF.SVRCONN/TCP/localhost(PORT NUMBER)
default port if not spec. is 1414
_________________
Jeff

IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries
Back to top
View user's profile Send private message Send e-mail
PeterPotkay
PostPosted: Sat Sep 27, 2003 2:06 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Jeff, (I think) you misunderstood Remco's question.

MachineA is the MQClient, and MachineB is the MQServer.

MachineB has a QM listening on some port, lets assume the default of 1414. It has a SVRCONN channel listening on this port.

Remco's question is from what port on MachineA does the MQClient send out its request to get to port 1414 on MachineB. I believe it is a random port allocated by TCP/IP. However, if the CLNTCONN channel is defined using the LOCLADDR attribute, you can tell MachineA what port (or range of ports) to send the request out to MachineB which is listening on port 1414.

You can only specify LOCLADDR for the CLNTCONN channel if you define it in a Client Channel Table or in the MQCONNX call. This is not possible for the MQSERVER variable.


If the LOCLADDR port is in use, TCP/IP requires a time period to release
the previously used port. If enough time is not left, and if only 1
LOCLADDR port is specified, the previously used port will not be available
and so a random port will be chosen rather than the LOCLADDR port.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
mrlinux
PostPosted: Sat Sep 27, 2003 2:47 pm    Post subject: Reply with quote

Grand Master

Joined: 14 Feb 2002
Posts: 1261
Location: Detroit,MI USA

in order to connect to qmgr on port 1414 the client has to use prt 1414 to establish the out going socket connection the response socket port returned from the open request will be a random port #
_________________
Jeff

IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries
Back to top
View user's profile Send private message Send e-mail
PeterPotkay
PostPosted: Sun Sep 28, 2003 9:08 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

MachineA = MQClient
MachineB = QueueManager1, listening on port 1414, SVRCONN channel called ServerConn.CHANNEL.

On MachineA:
SET MQCHLLIB=C:\
SET MQCHLTAB=ChannelTableNoLOCLADDR.tab

ChannelTableNoLOCLADDR.tab is a channel table for a CLNTCONN channel that points to ServerConn.CHANNEL on QueueManager1. This CLNTCONN channel has no LOCLADDR attribute set.

amqsputc is issued. Then issue netstat -a. The output of netstat -a shows that our ip address has connected to port 1414 of MachineB, and tcp has randomly assigened port 1778 to this session:

Code:

 TCP    MachineA:1778      MachineB.thehartford.com:1414  ESTABLISHED


Repeat this test several times and each time we connect to port 1414 on MachineB, and each time we get a random port# assigned on MachineA.

Since MQI channels are 2way communications, there is only 1 port opened for both sending and receiving MQ data, but that 1 port is random each time.

*************************************************
A new channel table is created called ChannelTableLOCLADDR1555.tab
Code:

ALTER CHANNEL(ServerConn.CHANNEL) CHLTYPE(CLNTCONN) LOCLADDR('(1555)')



On MachineA:
SET MQCHLLIB=C:\
SET MQCHLTAB=ChannelTableLOCLADDR1555.tab

ChannelTableLOCLADDR1555.tab is a channel table for a CLNTCONN channel that points to ServerConn.CHANNEL on QueueManager1. This CLNTCONN channel has the LOCLADDR attribute set to 1555.

amqsputc is issued. Then issue netstat -a. The output of netstat -a shows that our ip address has connected to port 1414 of MachineB, and tcp has assigened port 1555 to this session:

Code:

 TCP    MachineA:1555      MachineB.thehartford.com:1414  ESTABLISHED


Repeat this test several times and each time we connect to port 1414 on MachineB, and each time we get port#1555 assigned on MachineA. (You have to wait a few minutes in between tests for tcp to free up 1555 before you try again).


You can also create the CLNTCONN channel to tell TCP to pick a random port from a range that you specify, like perhaps 1550 thru 1600.
Code:

ALTER CHANNEL(ServerConn.CHANNEL) CHLTYPE(CLNTCONN) LOCLADDR('(1550,1600)')




Using LOCLADDR, you can dictate what port your MQClient will be sending and receiving data on. This attribuet is valid for all channels except SVRCONNs and RCVRs. Anytime you need a channel to go over a specific port, or range of ports, LOCLADDR can help.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Remco
PostPosted: Thu Oct 02, 2003 12:11 am    Post subject: Reply with quote

Acolyte

Joined: 19 Mar 2002
Posts: 68
Location: Capelle aan den IJssel (Rotterdam)

Thanks Peter...

This is a great answer.......
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Default outgoing Port number MQ Client
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.