In general, the client port number will be different for each new connection. I did not find evidence that OpenJMS clients use specific port numbers when communicating with servers. Here are some explanations.
Port numbers
When the client process first contacts the server process, it can use a known port number to initiate communication. Well-known port numbers are assigned to specific Internet services, IANA, the authority of Internet-assigned numbers. Known port numbers range from 0 to 1023.
Known ports are used only to establish communication between client and server processes. When this is done, the server allocates an ephemeral port number for later use. Ephemeral port numbers are unique port numbers that are assigned dynamically when processes begin to communicate. They are released when complete.
The TCP / IP client port (ephemeral) and the Client / Server application port use
In contrast, servers respond to clients; they do not initiate contact with them. Thus, the client does not need to use the reserved port number. This is actually an understatement: the server should not use a known or registered port number to send responses to clients. The reason is that for a particular device it is possible to have both client and server software of the same protocol, the same machine. If the server received an HTTP request on port 80 of its machine and sent a response back to port 80 on the client machine, it would send the response to the client computer HTTP server process (if present), and not the client process that sent the initial request.
To find out where to send the response, the server must know the port number the client is using. This is provided by the client as the source port in the request, and then used by the server as the destination port to send the response. Client processes do not use well-known or registered ports. Instead, each client process is assigned a temporary port number for its use. This is commonly called an ephemeral port number.
A similar answer to another question: How to determine the port number between client and server communications on the Internet :
In addition, the client can connect to many servers on the same port. When clients connect, they will use a random port on this end.
Only the server needs to worry about using a free port, and clients need to know what the port is, otherwise they will not be able to connect to your server.
Other possible help:
source share