3 Replies Latest reply on Dec 22, 2011 7:00 AM by rhusar

    remote ejb are not balanced

    morphy

      I succeded in connect a remote client to a server group with 2 running servers thanks to an hot fix (not distributed afaik) using the following client configuration

       

      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
      remote.connections=x1, x2
      
      remote.connection.x1.host=127.0.0.1
      remote.connection.x1.port = 4547
      remote.connection.x1.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
      
      remote.connection.x2.host=127.0.0.1
      remote.connection.x2.port = 4647
      remote.connection.x2.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
      
      

       

      This is possible in the domain thnx to a provided ejb-client-jar build installed from the file system

       

              <dependency>
                  <groupId>org.jboss</groupId>
                  <artifactId>jboss-ejb-client</artifactId>
                  <version>1.0.0.Beta8</version>
                  <type>jar</type>
                  <scope>runtime</scope>
              </dependency>
      
      

       

      the problem is that calling the remote method within a simple loop (for 1 to 10), calls are logged always in a single node (first run, 10 calls in x1... second run, 10 calls in x2 and so on)

       

          private void run() throws NamingException {
      
              HelloWorlder proxy = (HelloWorlder) context
                      .lookup("ejb:/TestRemoteBean//HelloWorlderBean!com.hp.dragon.test.HelloWorlder");
      
              for(int i=0;i<10;i++) {
                  String out = proxy.sayHello();
                  System.out.println(out);
              }
          }
      
      

       

      now i expected that multiple remote connections replace the ha-jndi behavior (connect the first available, balance calls across cluster nodes)

       

      i think this is a bug because i loose the balancing feature for remote clients... what are JBoss AS7 plans about remote proxies? How can i balance calls?

       

      thank you for your time

       

      PS failover is properly handled: if x1 is off, remote client succeds in calling x2