1 Reply Latest reply on Feb 26, 2008 1:30 PM by Brian Stansberry

    session affinity setup

    emmanuel valentin Newbie


      I am trying to configure a jboss 4.2.2GA in cluster with session affinity. My SFSB cannot be replicated. What I am trying to do is that a node is randomly chosen out of the one available and once the swing client is using this node, it is sticked to it, any new SFSB created in the same user session should be created on the same node.

      I have tried all solutions I knew. In the best case all my clients are connected to the first node because of the Jndi lookup. In another configuration I succeed to have the first bean created on a random node and the next one too but not the same, so my application fails.

      Is there any solution to my problem using only JBoss feature ?

      thanks for your help and advice.

        • 1. Re: session affinity setup
          Brian Stansberry Master

          Sounds like you want HA-JNDI affinity -- i.e. once a user connects to JNDI on a particular node in the cluster, he always uses that node. If none of your EJBs on the node are clustered, when you download an EJB proxy from JNDI, the proxy will always talk back to the server it came from.

          Something you can try -- in the all/dpeloy/cluster-service.xml file, HA-JNDI mbean you find this:

          <attribute name="LoadBalancePolicy">org.jboss.ha.framework.interfaces.RoundRobin</attribute>

          Try changing it to:

          <attribute name="LoadBalancePolicy">org.jboss.ha.framework.interfaces.FirstAvailableIdenticalAllProxies</attribute>

          With that, once a client VM accesses a particular node via HA-JNDI, all further access from the VM will use that same node, unless the node fails.

          BIG CAVEAT: I've never tried this, never heard of anyone trying it, and have thought about it for about 10 minutes. Use caution, test well, don't be surprised if there are issues, etc etc.

          Note that this architecture doesn't sound HA at all.