3 Replies Latest reply on Jan 11, 2008 1:04 PM by Brian Stansberry

    querying ejb proxy stub for available nodes

    Adrian Dimulescu Newbie

      Hello,

      suppose I have just looked up an ejb proxy on a cluster (jnp://machine:1100). Can I somehow query it in order to know the available nodes in the cluster ?

      I have tried introspecting an ejb proxy, no success. I have read http://www.ieeetcsc.org/newsletters/2003-02/labourey.html and I do have an user-level understanding of JBoss clustering, still I need some help.

      Thanks.

        • 1. Re: querying ejb proxy stub for available nodes
          Shoeb Khan Newbie

          Nodes come and go. I don't if it is possible to come to know about number of nodes in the cluster from client application. However, if you have 10 nodes that are not active all the time, while some are active other might be sleeping, then you can put their names in the client url string separated by a comma, ,AFAIT, they will not be called by the application server

          Hope that helps.

          • 2. Re: querying ejb proxy stub for available nodes
            Adrian Dimulescu Newbie

             

            "shoeb1981" wrote:
            Nodes come and go.


            Thanks for your answer. Of course I mean the nodes at lookup time, I realize that they may change.

            I should be possible, the load balancing and failover logic is in the smart stub, not on the server.

            • 3. Re: querying ejb proxy stub for available nodes
              Brian Stansberry Master

              You can call org.jboss.ha.framework.interfaces.ClusteringTargetsRepositorygetFamilyClusterInfo(String) to get the org.jboss.ha.framework.interfaces.FamilyClusterInfo object for the bean. From there you can call FamilyClusterInfo.getTargets() to get back an array list of targets (i.e. objects that allow the proxy to communicate with a cluster node.)

              Problem is the targets are not necessarily user-friendly; e.g. if you are using the JRMP invoker (default) the target will be an RMI stub.

              Turn on TRACE level logging of org.jboss.ha on the client side; you'll see messages to clue you in on what String to pass to ClusteringTargetsRepositorygetFamilyClusterInfo().