7 Replies Latest reply on Apr 27, 2006 5:46 PM by Bela Ban

    JChannelFactory integration in JBoss AS

    Brian Stansberry Master

      Discussions of http://jira.jboss.com/jira/browse/JBAS-3148 .

      Copied from a recent e-mail by Bela:

      Example of how a Multiplexer MBean can be created is in http://jira.jboss.com/jira/browse/JGRP-112 .

      The multiplexer-service.xml looks as follows:

      <server>
       <mbean code="org.jgroups.jmx.JChannelFactory"
      name="jgroups:name=Multiplexer">
       <attribute name="MultiplexerConfig">stacks.xml</attribute>
       </mbean>
      </server>
      


      The interface is:
      public interface JChannelFactoryMBean {
       void setMultiplexerConfig(String properties) throws Exception;
       Channel createMultiplexerChannel(String stack_name, String id) throws Exception;
       Channel createMultiplexerChannel(String stack_name, String id, boolean register_for_state_transfer, String substate_id) throws Exception;
       void create() throws Exception;
       void start() throws Exception;
       void stop();
       void destroy();
       String dumpConfiguration();
       String dumpChannels();
      }


      The description is under www.jgroups.org (user's guide, 2.3).

      I suggest an additional configuration for JBossCache and JBoss Clustering, with new attributes
      <attribute name="Multiplexer">jgroups:service=JGroupsMultiplexer</attribute>
      <attribute name="ApplicationID">TC5-Cluster</attribute>


      All ApplicationIDs have to be unique.

      How to Use:

      1: Set the Multiplexer MBean ref in your MBean using dependency injection (depends-optional-attribute), or fetch the ref in create()
      2: in create(): get a channel with
      JChannelFactoryMBean.createMultiplexerChannel(stackName, YourID, register_for_state_transfer, substate)
      The 3rd parameter needs to be true when your app requires state (as for all replicated JBossCache instances). Set the 4th to null for now
      3: in start(): call getState().


      Look at MultiplexerTest.testStateTransferWithRegistration() for an example.

      If you have issues with the online docs for JGroups 2.3, try http://www.jgroups.org/html.zip.

        • 1. Re: JChannelFactory integration in JBoss AS
          Brian Stansberry Master

          Jerry,

          Probably the first thing to do is get a version of JG 2.3 integrated into the JBoss repository for HEAD. This can probably be a snapshot if Bela has no plans for a beta before you want to get going. Suggest you coordinate with Bela as to what jgroups.jar to use. Suggesting contacting Ruel Loehr to figure out how to integrate a snapshot into the repository and the HEAD build. The build part is controlled via the build/build-thirdparty.xml file; I believe there are some other artifacts in there that are using a snapshot.

          • 2. Re: JChannelFactory integration in JBoss AS
            Brian Stansberry Master

            For the 5.x series, for ClusterPartition I see no reason to support anything other than getting the channel from a separate JChannelFactory -- i.e. no support for the old style of creating your own channel from the JGroups properties.

            For 4.0.5 and later 4.0.x releases, we would want to support the old style for ClusterPartition, since backward compatibility issues mean the old style will be the default.

            JBossCache is a separate issue.

            Thoughts?

            • 3. Re: JChannelFactory integration in JBoss AS
              Bela Ban Master

              Yes, I think if the 2 attributes are defined, that would override creation of a separate channel, and you would always use the Multiplexer.
              I intend to release 2.3 beta this or next week, it is functionally complete and the testsuite has been passing for quite some time (weeks) at 100% now...

              Maybe we do this first on JBoss 5, so we can see whether we have all of our tracks covered

              • 4. Re: JChannelFactory integration in JBoss AS
                Brian Stansberry Master

                Definitely JBoss 5 first. Thanks for clarifying that; I mention 4.0.x as a design detail, but not as a work priority. My attitude toward 4.0.x is we should largely be in bug fix mode until we have 5.0.0 well in hand. Only port new features back if it's a simple copy-paste type thing of largely identical code or you can't find other 5.0 work to do. Otherwise raise a JIRA to port it later and go attack another 5.0 issue.

                • 5. Re: JChannelFactory integration in JBoss AS
                  Jerry Gauthier Apprentice

                  Bela - shall I add JGroups 2.3 beta to JBossAS 5 or will you do this? If you want me to do it, is it jgroups-all.jar that's incorporated as jgroups.jar? I have the jgroups-core beta jar that you included in the Multiplexer sar but I don't have the jgroups-all beta distribution. SourceForge hasn't been updated yet to include the beta code.

                  If we're not ready to update JBossAS 5 yet, I can work locally with the beta jar.

                  • 6. Re: JChannelFactory integration in JBoss AS
                    Brian Stansberry Master

                    We want to move to the 2.3 beta in AS HEAD; no reason to wait. Bela mentioned on the phone this morning there may be some issues re: following the JBoss version naming rules for the beta release (or something like that).

                    I'll leave it to you and Bela to sort out the details, but once you do please go ahead and convert HEAD to the 2.3 beta.

                    • 7. Re: JChannelFactory integration in JBoss AS
                      Bela Ban Master

                      I'll add JGroups 2.3 beta to repository.jboss.com tomorrow (FRI), let's have a quick chat tomorrow (ping me on YIM) to discuss the details