1 Reply Latest reply on Sep 3, 2018 9:05 AM by rhusar

    Sticky Session - Not Working

    hasithajayan

      I have made simple cluster in my network. It has two Wildfly 9 servers and i configure Undertow like bellow.

       

      <subsystem xmlns="urn:jboss:domain:undertow:2.0" instance-id="node1">

       

      <subsystem xmlns="urn:jboss:domain:undertow:2.0" instance-id="node2">

       

      And create Undertow load balancer like bellow.

       

      LoadBalancingProxyClient loadBalancer = new LoadBalancingProxyClient()

            .addHost(new URI("http://10.205.16.12:8081"),"node1")

            .addHost(new URI("http://10.205.16.13:8082"),"node2")

            .setConnectionsPerThread(1000);

          Undertow reverseProxy = Undertow.builder()

            .addHttpListener(80,"0.0.0.0")

            .setIoThreads(8)

            .setHandler(new ProxyHandler(loadBalancer, 30000, ResponseCodeHandler.HANDLE_404))

            .build();

            reverseProxy.start();

            System.out.println("[Undertow] load balancer is running...");

       

      When i do some load testing seems this work fine. Requests are distributed among two servers but their sessions are stick. But when i do the same thing in Wildfly 10.1, session are not stick. Requests are not gone to the same node. What is the cause for this and is there any different configuration need to do in  Wildfly 10.1?