4 Replies Latest reply on Sep 21, 2008 6:26 AM by timfox

    jms and fault tolerance

    francesco_81

      HI all,

      I've a problem in the following scenario:

      there is a clusterd JBoss environmet with 2 or more messaging-node (call it mnode0, mnode1, ...), a distributed topic (call it 'mytopic'), a Publisher and a Subscriber applications on 'mytopic'. In both the pub and the sub I lookup a 'ConnectionFactory' referring to a the jndi service resolved with the url of mnode0 (e.g. 192.168.0.1:1199).

      The publisher periodically sends a message.
      The listener (of the sub) receives them.

      If mnode0 crash on the pub I've got an exception and the listener isn't able to know that an error has happened. It isn't a nice behaviour,

      Is there a manner to route the messages to an other node of the cluster of AS in order to get fault tolerance? Have I to configure the post office?

      I used JB_AS 4.2.2GA and JBM 1.4.0SP3 with MySql. I've done every step of the 'JBoss Messaging Installation (chap 4 of JBoss Messaging 1.4 User's Guide)

      Regards.

      Francesco

        • 1. Re: jms and fault tolerance
          noelo

          Using the clusteredconnectionfactory rather than just the standard connectionfactory may help. See http://www.jboss.org/file-access/default/members/jbossmessaging/freezone/docs/userguide-1.4.0.SP3/html_single/index.html#conf.connectionfactory

          • 2. Re: jms and fault tolerance
            francesco_81

            I've used the ClusterConnectionFactory but the result is the same.

            What are the attributes that I've to set in the mbean ClusteredConnectionFactories in the file connection-factories-service.xml that I post below?

            I've read somewhere that there is the need to make persistence-messages in order to get fault tolerance. How can I send/receive persistent messages? Are there some further configurations step to do (e.g. in the mysql-persitence-service.xml ). Are only this type of messages take in considetarion by buddy node(s).

            
            <?xml version="1.0" encoding="UTF-8"?>
            
            <!--
             Messaging Connection Factories deployment descriptor.
            
             $Id: connection-factories-service.xml 3332 2007-11-15 09:32:43Z timfox $
             -->
            
            <server>
            
             <!-- The default connection factory does not support automatic failover or load balancing-
             this is so we can maintain compatiblity with applications written for JBoss MQ which use this
             connection factory.
             -->
             <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
             name="jboss.messaging.connectionfactory:service=ConnectionFactory"
             xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
             <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
             <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
             <depends>jboss.messaging:service=PostOffice</depends>
            
             <attribute name="JNDIBindings">
             <bindings>
             <binding>/ConnectionFactory</binding>
             <binding>/XAConnectionFactory</binding>
             <binding>java:/ConnectionFactory</binding>
             <binding>java:/XAConnectionFactory</binding>
             </bindings>
             </attribute>
             </mbean>
            
             <!-- A clustered connection factory that supports automatic failover and load balancing of created
             connections.
             This factory is not suitable to be used by MDBs.
             -->
             <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
             name="jboss.messaging.connectionfactory:service=ClusteredConnectionFactory"
             xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
             <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
             <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
             <depends>jboss.messaging:service=PostOffice</depends>
            
             <attribute name="JNDIBindings">
             <bindings>
             <binding>/ClusteredConnectionFactory</binding>
             <binding>/ClusteredXAConnectionFactory</binding>
             <binding>java:/ClusteredConnectionFactory</binding>
             <binding>java:/ClusteredXAConnectionFactory</binding>
             </bindings>
             </attribute>
            
             <attribute name="SupportsFailover">true</attribute>
             <attribute name="SupportsLoadBalancing">true</attribute>
             </mbean>
            
             <!-- A connection factory with no JNDI bindings that is used in clustering to create the connections that
             pull messages from one node to another
             -->
             <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
             name="jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory"
             xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
             <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
             <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
             <depends>jboss.messaging:service=PostOffice</depends>
             <attribute name="SupportsFailover">false</attribute>
             <attribute name="SupportsLoadBalancing">false</attribute>
             </mbean>
            
             <!-- An example connection factory with all attributes shown
            
             <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
             name="jboss.messaging.connectionfactory:service=MyExampleConnectionFactory"
             xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
            
             <constructor>
            
             <!- - You can specify the default Client ID to use for connections created using this factory - ->
            
             <arg type="java.lang.String" value="MyClientID"/>
            
             </constructor>
            
             <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
            
             <!- - The transport to use - can be bisocket, sslbisocket or http - ->
            
             <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=http</depends>
            
             <depends>jboss.messaging:service=PostOffice</depends>
            
             <!- - PrefetchSize determines the approximate maximum number of messages the client consumer will buffer locally - ->
            
             <attribute name="PrefetchSize">150</attribute>
            
             <!- - Paging params to be used for temporary queues - ->
            
             <attribute name="DefaultTempQueueFullSize">200000</attribute>
            
             <attribute name="DefaultTempQueuePageSizeSize">2000</attribute>
            
             <attribute name="DefaultTempQueueDownCacheSize">2000</attribute>
            
             <!- - The batch size to use when using the DUPS_OK_ACKNOWLEDGE acknowledgement mode - ->
            
             <attribute name="DupsOKBatchSize">5000</attribute>
            
             <!- - Does this connection factory support automatic failover? - ->
            
             <attribute name="SupportsFailover">false</attribute>
            
             <!- - Does this connection factory support automatic client side load balancing? - ->
            
             <attribute name="SupportsLoadBalancing">false</attribute>
            
             <!- - The class name of the factory used to create the load balancing policy to use on the client side - ->
            
             <attribute name="LoadBalancingFactory">org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory</attribute>
            
             <!- - Whether we should be strict TCK compliant, i.e. how we deal with foreign messages, defaults to false- ->
            
             <attribute name="StrictTck">true</attribute>
            
             <!- - Disable JBoss Remoting Connector sanity checks - There is rarely a good reason to set this to true - ->
            
             <attribute name="DisableRemotingChecks">false</attribute>
            
             <!- - The connection factory will be bound in the following places in JNDI - ->
            
             <attribute name="JNDIBindings">
            
             <bindings>
            
             <binding>/acme/MyExampleConnectionFactory</binding>
            
             <binding>/acme/MyExampleConnectionFactoryDupe</binding>
            
             <binding>java:/xyz/CF1</binding>
            
             <binding>java:/connectionfactories/acme/connection_factory</binding>
            
             </bindings>
            
             </attribute>
            
             </mbean>
            
             -->
            
            </server>
            
            


            • 3. Re: jms and fault tolerance
              francesco_81

              I solved my problem.

              i just simulated the crash of a messaging-node siple sendig the TERM signal. If I send the KILL signal to the AS than the fault tolerance just happen.

              • 4. Re: jms and fault tolerance
                timfox

                 

                "francesco_81" wrote:
                I solved my problem.

                i just simulated the crash of a messaging-node siple sendig the TERM signal. If I send the KILL signal to the AS than the fault tolerance just happen.


                Yes, that's in one of the FAQs