Skip to content

DiKode

Coding Journal

Menu
  • Home
  • Author
  • Contact Me
  • Category
    • Java
    • Javascript
  • Privacy Policy
Menu

jPOS MUXPool as Load Balancer

Posted on August 18, 2015October 26, 2017 by didikhari

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

jPOS MUXPool as Load Balancer
jPOS MUXPool as Load Balancer

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]

client-channel-A.send
client-channel-A.receive
30000

[/xml]

[xml]

client-channel-B.send
client-channel-B.receive
30000

[/xml]

And then, create two mux that will use each channel adaptor.
[xml]


client-channel-A.receive
client-channel-A.send
client-channel-A.ready

[/xml]

[xml]


client-channel-B.receive
client-channel-B.send
client-channel-B.ready

[/xml]

We have to pay attention with in out for each mux and channelAdapter. And the MUXPool configuration just like this:

[xml]

client-mux-A client-mux-B
round-robin

[/xml]

That’s All the jPOS MUXPool as Load Balancer.. Hope this post can help you. Thanks for visiting my blog.

8 thoughts on “jPOS MUXPool as Load Balancer”

  1. demigod says:
    September 10, 2015 at 3:22 am

    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?

    Reply
    1. Didik H says:
      September 10, 2015 at 6:05 am

      i use this line to get the mux.

      MUX mux = (MUX) NameRegistrar.get("mux.client-mux");

      Yes, MUXPool will automatically choose the mux of registered muxes to send request based on your strategy config.

      Reply
  2. adhi says:
    September 18, 2015 at 2:51 am

    why not use

    on channel property?

    Reply
    1. Didik H says:
      September 18, 2015 at 6:30 am

      Sorry, i dont know that channel property can be used for internal load balancer.

      could you share the approach?

      Reply
      1. adhi says:
        September 19, 2015 at 6:30 am

        true
        send
        receive
        ready
        10000

        Reply
        1. Didik H says:
          September 22, 2015 at 1:03 am

          Hi Adhi..
          So, how it work as load balancer?

          Reply
  3. Frank Lawlor says:
    April 28, 2020 at 3:01 pm

    Very interesting. We are using jPOS 1.8.2. Will the MUXPool there work?
    Thanks.

    Reply
    1. didikhari says:
      October 11, 2020 at 3:57 pm

      Yes, i think so.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Java
  • Javascript
  • jPOS

Recent Post

  • jPOS Server in-out
  • How to Configure Basic Auth Spring RestTemplate
  • Create Custom jPOS ISO8583 Packager
  • Binding Restful XML Parameter
  • Create Dynamic Tree Grid using TreeGrid jQuery Plugin

Tags

Asynchronous Request async request Bind Json Param custom channel custom jPOS packager datatables Design Pattern hibernate http http basic auth http request iso 8583 java javascript jPOS jpos channel jPOS Client jPOS database jPOS deploy directory jPOS Hibernate jpos http jpos rest jPOS Server jpos Space jquery js jsf load balancer moxy mux mux pool prettyfaces primefaces rest client Restful SAF space Specifications spring framework TCP Template Method transaction manager transaction participant tree TreeGrid

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2021 DiKode | Built using WordPress and Responsive Blogily theme by Superb