TCP/IP multiple host and port numbers

Skip to first unread message

James Loveday

Aug 3, 2022, 5:00:38 AMAug 3
to jPOS Users
Guys I really need your input again 

I have a requirement to connect to a client using Hex over TCP/IP 

In this case they have a primary and secondary where the transactions flow in round-robin fashion to the client, if any connection fails then all transactions need to direct to the single connection that is alive for the duration that the other connection is down. 

I have some config that uses the channel adaptor and sets a channel and I have an idea that we can use a participant class to obtain the channel adaptor and swap the host and port as needed but my head tells me this is a bad idea as TCP/IP was never meant to have that level of flexibility. 

Any advice you can give me here would be welcomed. 

Sumeet Phadnis

Aug 3, 2022, 7:49:35 AMAug 3
MUXPool is your friend.

jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact:
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

murtuza chhil

Aug 4, 2022, 7:36:35 AMAug 4
to jPOS Users

Define your channel deploys [channel1…channelN] with IP:port.
Define a mux for each channel [mux1…muxN]
Define a muxpool and configure it with your muxes

<mux class="org.jpos.q2.iso.MUXPool" logger="Q2" name="my-muxpool">
 <muxes>mux1 mux2 .... muxN</muxes>

strategy can be one of the following

Now get the muxpool from the nameregistrar as you would do for the mux QMux.getMux(“my-muxpool”).
Use the muxpool to send the request (Qmux and Muxpool both implement Mux).. It will send it based on the strategy configured.


James Loveday

Sep 16, 2022, 4:55:24 AMSep 16
to jPOS Users
Thanks Chhil that worked perfectly. 
Reply all
Reply to author
0 new messages