6 Replies Latest reply on May 27, 2013 4:37 PM by mautner.adam

    Clustered EJB Lookup using JGroups

    mautner.adam

      Hi All,

       

      I have extended the Quickstarts ejb-remote: Remote EJB Client Example [http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/ejb-remote/] to call the EJB in a local

       

      cluster.

       

      It is all working fine, when I explicitly define the cluster host and port in jboss-ejb-client.properties like:

       

      remote.connections=node1, node2

       

      remote.connection.node1.host=localhost

      remote.connection.node1.port = 4457

      remote.connection.node1.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

       

      remote.connection.node2.host=localhost

      remote.connection.node2.port = 4557

      remote.connection.node2.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

       

      Is there any way to receive this information from JGroups since JBoss Clustering is already using JGroups. I would like to use a non-UDP based JGroups connection (e.g.

       

      file ping or JDBC ping).

       

      I am using jboss-as-7.1.1.Final.

       

      Can some one please help?

       

      Regards,

       

      Adam

        • 1. Re: Clustered EJB Lookup using JGroups
          wdfink

          I suppose I understand your question, correct me if I'm wrong.

           

          You need to have the cluster information in the jboss-ejb-client.properties, see this example project.

           

          By default add

          # Declare the cluster(s)

          remote.clusters=ejb

           

          notice that you need to add connect option, credentials etc for the cluster also.

          the cluster name ejb is from the cluster bean configuration, if there are no changes in the config the default is ejb

           

          There is this EJBCLIENT-47 request, you may vote for it, to simplify the configuration and have the same automatic behaviour as in former releases,

          • 2. Re: Clustered EJB Lookup using JGroups
            mautner.adam

            Hi,

             

            First of all thank you for the quick reply.

             

            I think we are on the same page. I am trying to build a load balanced/high availability cluster of stateless session beans. I actual managed test both load balance and high availability using the following config:

             

            remote.connections=node1, node2

             

            remote.connection.node1.host=localhost

            remote.connection.node1.port = 4457

            remote.connection.node1.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

             

            remote.connection.node2.host=localhost

            remote.connection.node2.port = 4557

            remote.connection.node2.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

             

            I didn't need to use "remote.clusters=ejb" for it.

             

            What I'm actually looking for is how to discover nodes from the cluster (node1, node2) using JGroups, so I don't need to specify host connection information explicitly. I have found some reference about UDP lookup, but I would like to use other JGroups protocols like FILE_PING or JDBC_PING. JBoss itself seems to be able to use any of these JGroups protocols. I thought it would be nice to use the same method to lookup hosts in the client.

             

            Regards,

             

            Adam

            • 3. Re: Clustered EJB Lookup using JGroups
              wdfink

              You need to set at minimum one connection for the ejb-client, if you set "remote.clusters" this will add all nodes of this cluster to your client view.

               

              At the moment there is no multicast autodiscovery option for the client to discover a cluster as this was in former JBoss version with the jnp protocoll.

              • 4. Re: Clustered EJB Lookup using JGroups
                mautner.adam

                Hi,

                 

                Thank you. Is there any plan to add autodiscovery option (with JGroups) in the next few versions?

                 

                Regards,

                 

                Adam

                • 5. Re: Clustered EJB Lookup using JGroups
                  wdfink

                  I'm not aware of.

                   

                  But you might file a JIRA enhancement request to reintroduce this feature.

                  • 6. Re: Clustered EJB Lookup using JGroups
                    mautner.adam

                    Hi,

                     

                    OK, sure. I'm just evaluating JBoss at the moment. I may file a Jira later.

                     

                    Thanks for the information.

                     

                    Regards,

                     

                    Adam