As promised before, today i want to share about using jPOS MUXPool as Load Balancer. This is internal load balancer, so we don’t need to buy external load balancer. The idea is using two layer instance, the load balancer instance and worker instance.
The benefit when using MUXPool is, that when there are fault for example link down on Instance 1, MUXPool will automatically send the request with next available MUX.
In this post, i will share the MUXPool configuration. But, if you really need the source, you can contact me here
With jPOS version 1.9.2 MUXPool, there are two load balancing methods: Round Robin, and Primary Secondary methods. From the latest version, there are four type balancing you can find here
First, create two channel that using same configuration specs, but different destination port.
[xml]
[/xml]
[xml]
[/xml]
And then, create two mux that will use each channel adaptor.
[xml]
[/xml]
[xml]
[/xml]
We have to pay attention with in out for each mux and channelAdapter. And the MUXPool configuration just like this:
[xml]
[/xml]
That’s All the jPOS MUXPool as Load Balancer.. Hope this post can help you. Thanks for visiting my blog.
Hi, so in order to use MUXPool as load ballance I should use
MUXPool pool = (MUXPool) NameRegistrar.getIfExists(“client-mux”);
instead of the usual
MUX mux = QMUX.getMUX(cfg.get(“client-mux”));
so the MUXPool will automatically manage the incoming request based on the registered muxes and the strategy defined?
i use this line to get the mux.
Yes, MUXPool will automatically choose the mux of registered muxes to send request based on your strategy config.
why not use
on channel property?
Sorry, i dont know that channel property can be used for internal load balancer.
could you share the approach?
true
send
receive
ready
10000
Hi Adhi..
So, how it work as load balancer?
Very interesting. We are using jPOS 1.8.2. Will the MUXPool there work?
Thanks.
Yes, i think so.