1 Reply Latest reply on Feb 25, 2005 9:42 AM by fredrikbromee

    Implementing node affinity for a stateless session bean

    plindsay

      Given the jboss clustering arch., how can I deploy a stateless session bean across a cluster and always execute the SLSB on the same node? We require this due to external interface requirements. If the primary node fails, we would like another node to replace the primary. But only a single node at a time can service this specific SLSB interface. We have accomplished this in WLS via a custom LB router.
      Thanks for any information.

        • 1. Re: Implementing node affinity for a stateless session bean

          If I understand your question correctly, it would be OK if the session bean were deployed on all nodes but only was called on one of the nodes.

          One way to do this in JBoss would be like you did in WLS, to use a custom load balancer that dispatches all requests to the bean to one of the nodes as long as that node is alive.

          Another way might be to do it as a remote-enabled HA singleton service. A clustered singleton service is deployed on all nodes in a cluster but only runs on one of them - the master node. When the master node fails a new master is elected among the remaining nodes. This is the kind of functionality you're looking for, right?

          In our setup we use HA singleton services as timed services triggered by time (do this every three hours, do this every day before midnight etc). However this thread http://www.jboss.org/index.html?module=bb&op=viewtopic&t=55794
          shows how an HA singleton service can be remotely called just like any session bean.

          Hope this helps,
          /Fredrik