3 Replies Latest reply on Apr 4, 2010 9:31 PM by ron_sigal

    JBoss Remoting in AS Cluster

    medlw

      Additionally to the post in the AS Clustering Community I post it also here:

      I configured and deployed a simple  Remoting Application into a 4.2.2 AS and run it successfully (below my  mbean-definition).  I set up a 2-node cluster using the default cluster  configuration by starting each server with "run -c all" (having prooved  that the node did recognise each other). Then I ran over some seconds  hundreds of calls in different threads using different connections. Only  the Server which is contained in thelocatorUrl did respond. Principally  what do I have to do to run the JBoss Remoting in a cluster and observe  some sort of load balancing?

      Do I have to use a special  connector or transport? What about Cluster-Policy-Hints like @Clustered(loadBalancePolicy="RoundRobin"....?

       

      Her the simple mbean definition:

      <server>

       

      <mbean  code="org.jboss.remoting.transport.Connector"
      name="jboss.remoting:service=Connector,transport=Socket"
      display-name="Socket  transport Connector">
      <attribute name="InvokerLocator">
      <![CDATA[socket://localhost:5400]]>
      </attribute>
      <attribute  name="Configuration">
      <config>
      <handlers>
      <handler   subsystem="cluster">medl.remoting.cluster.server.SimpleInvocationHandler</handler>
      </handlers>
      </config>
      </attribute>
      </mbean>
      </server>

       

      Thanks in  advance

        • 1. Re: JBoss Remoting in AS Cluster
          ron_sigal

          Hi Wolfgang,

           

          If I understand correctly, you're talking about a pure Remoting example, right?  That is, the client creates an org.jboss.remoting.Client?

           

          Remoting 2 doesn't have any built in load balancing facility, so you'd have to write your own.  There's a failover facility in the transporter code, if you want to look at that. See section "12.9.5. Transporter sample - clustered" of the Remoting Guide (http://www.jboss.org/file-access/default/members/jbossremoting/freezone/docs/guide/2.5/html/index.html) for a discussion.

           

          -Ron

          • 2. Re: JBoss Remoting in AS Cluster
            medlw

            Dear Ron
            Yes Your are correct, but we need the cluster not (only) for failover but for load balancing. Though I can deploy my Remoting service into the cluster, it does only work locally.
            Is there a possibility to keep the client more or less as it is and put an EJB-facade in-between to achieve the load balancing?

             

            Yours sincerely

            Wolfgang

            • 3. Re: JBoss Remoting in AS Cluster
              ron_sigal

              Hi Wolfgang,

               

              To tell you the truth, I don't know enough about clustering to give a definitive answer, but I would say that an important consideration is whether the application is stateful.  Clustering uses caching to share state among machines, so, if you need to share state, I think you would have a lot of work to reach your goal.  In that case, I think you might want to adapt your client to use EJBs, with all of their built in infrastructure, instead of invoking Remoting directly.  If you don't have shared state, then I guess you could just start up a Remoting server in each AS instance, but that still doesn't give you load balancing.  Again, you might be better off using the built in EJB mechanisms.

               

              -Ron