MUXPool configuration + strategies

338 views
Skip to first unread message

map...@gmail.com

unread,
Jun 21, 2021, 10:40:34 AM6/21/21
to jPOS Users
Hi there! I have a question related to MuxPool different strategies, where can I find info about:
And also wanted to know if there's any extra configuration in the deploy xml files using any of these strategies?

Thanks in advance!

Arsalan Khan

unread,
Jun 24, 2021, 9:54:12 AM6/24/21
to jPOS Users
You should have a look in the code, its quite simple 
https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/q2/iso/MUXPool.java#L231

By default without specifying <strategy> tag in the deployment - it goes with PRIMARY_SECONDARY

Frank Lawlor

unread,
Jul 22, 2021, 3:00:54 PM7/22/21
to jPOS Users
I looked at the code but I still have some questions about the behavior of the Primary/Secondary strategy.

1) If the Primary fails I assume the MUXPool will switch over to the Secondary.  
When the Primary is restored does the connection stay on the Secondary?  
That is, only a disconnect causes a switch.

2) Assuming my MUXPool is up and waiting, as the primary and secondary servers come up
will whichever one comes up first be the active even if it is the secondary?

3) If the connection is the Primary and I want to take it down for service,
is there a way to force a failover to the Secondary? 
I can't just kill the Primary because there are in-flight messages being processed.

In short I need a state diagram of Primary active/available/failed and Secondary active/available/failed
and the transitions due to bringup, failures, etc.

Frank Lawlor

unread,
Jul 22, 2021, 3:01:09 PM7/22/21
to jPOS Users
I looked thru the MUXPool.java but didn't understand how the changing availability/activity of the Primary and Secondary MUXs is handled.

1) For example, I assume that If the Primary and Secondary are both available and traffic is going to the Primary, then if it fails, traffic will go to the Secondary.  But what happens when the Primary rejoins (is connected).  I would hope traffic remains going to the secondary, but I don't see how I can determine that from looking at the code.

2) With both P & S available and traffic going to the Secondary, a Secondary failure will now cause traffic to go back to the Primary, right?

3) If traffic is going to one of the servers (lets say the Primary) can I force a switch to the Secondary so that I can remove the Primary without traffic disruption so that I can service it?

In short, there should be a state machine description of the behavior with primary active/standby/failed, secondary active/standby/failed and server available events forcing transitions.

Thanks for your help.
On Thursday, June 24, 2021 at 8:54:12 AM UTC-5 nalas...@gmail.com wrote:

murtuza chhil

unread,
Nov 8, 2021, 8:51:23 PM11/8/21
to jPOS Users

When you configure primary-secondary the mux is determined by this code

Primary secondary works based on the first mux that is connected  in order its defined.
So if your muxpool has a primaryMux and secondaryMux, it will always try the primary first and if its connected it will send it via primary. If its not connected, it will use the secondary. 

> But what happens when the Primary rejoins (is connected).
Primary will be used.

> With both P & S available and traffic going to the Secondary, a Secondary failure will now cause traffic to go back to the Primary, right?
If P is available traffic will always go through P. S is only used for the time P is unavailable.

> If traffic is going to one of the servers (lets say the Primary) can I force a switch to the Secondary so that I can remove the Primary without traffic disruption so that I can service it?
The only way to force it  to not use the primary to remove the channel deploy associated with the mux.
Alternatively you can swap the muxes around in the mux pool to make the secondary a primary and vice versa and deploy the change, now you can work on the new secondary.

-chhil

Reply all
Reply to author
Forward
0 new messages