2 Replies Latest reply on Jan 25, 2010 10:52 AM by abelinschi

    Problem with the bridge reconnecting to remote topic.

    abelinschi

      Hello all,

       

      I need some helpin understanding what is going on with the message bridge connectedbetween a local queue and a remote topic. The bridge is configured to use durable subscriptions and to absorb messages from the remote topic and send them to the local queue. If the remote JBoss node is 'down' then the bridge suppose to retry to establish a connection. Everything is working as expected. What happens is that, sometimes, when the remote JBoss instance is down for a long time then the bridge connects to the local JBoss instance instead and creates the subscription on the local topic which is wrong (it should only connect to the specified IP address).

       

      Any idea why that happens?

       

      Here is my configuration:


      Both nodes are running JBoss 5.1.0 GA with JBoss messaging 1.4.6 and JBoss remoting 2.5.2.SP1

      I am running two clusters 'Cluster1' and 'Cluster2'. Each cluster is configuring for using 'tcp'. Jboss messaging is using Oracle for persistence, it is configured to use 'tcp' for both JBM control andJBM data channels, the post office is clustered.


      A clustered topic 'DataTopic' deployed to both 'Cluster1' and 'Cluster2'.

      A clsutered queue 'DataQueue' deployed to both Cluster1 and Cluster2

       

      Each cluster is running 6 JBoss instances. All of the nodes cluster correctly.

       

      The Bridge is deployed on Cluster1 as a singleton and should absorb messages from 'DataTopic' on Cluster2 and send them tothe local 'DataQueue' on Cluster1.

       

       

       

      Here are some of environment variables passed to each JBoss instances:


      -Djboss.messaging.ServerPeerID=${SERVER_PEER_ID}"
      -Djboss.partition.name=cfssys -Djboss.messaging.groupname=cluster1
      -Djboss.service.binding.set=${PORTS_VAR}"
      -Djboss.default.jgroups.stack=tcp
      -Djgroups.tcpping.initial_hosts=10.1.22.110[7600],10.1.22.111[7600],10.1.22.112[7600],10.1.22.113[7600],10.1.22.114[7600],10.1.22.115[7600]"

       

      Here is the bridge file deployed to ' appserver/server/all/deploy-hasingleton/' location:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.messaging:service=Bridge,name=SyncInBridge" xmbean-dd="xmdesc/Bridge-xmbean.xml">
        <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteCluster2</depends>
        <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
        <attribute name="SourceDestinationLookup">/topic/DataTopic</attribute>
        <attribute name="TargetDestinationLookup">/queue/DataQueue</attribute>
        <attribute name="SourceUsername">user</attribute>
        <attribute name="SourcePassword">pass</attribute>
        <attribute name="QualityOfServiceMode">2</attribute>
        <attribute name="MaxBatchSize">10</attribute>
        <attribute name="MaxBatchTime">5000</attribute>
        <attribute name="SubName">SubCluster2</attribute>
        <attribute name="ClientID">222</attribute>
        <attribute name="FailureRetryInterval">60000</attribute>
        <attribute name="MaxRetries">-1</attribute>
        <attribute name="AddMessageIDInHeader">false</attribute>
      </mbean>

       

       

      Here are my JMS provider definitions (jms-ds.xml):

       

      <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
         <tx-connection-factory>
            <jndi-name>JmsXA</jndi-name>
            <xa-transaction/>
            <rar-name>jms-ra.rar</rar-name>
            <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
            <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
            <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
            <max-pool-size>20</max-pool-size>
            <security-domain-and-application>JmsXARealm</security-domain-and-application>
            <depends>jboss.messaging:service=ServerPeer</depends>
         </tx-connection-factory>

       

       

       

         <!-- Remote JMS Provider -->
         <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.messaging:service=JMSProviderLoader,name=RemoteCluster2">
            <attribute name="ProviderName">
      RemoteCluster2</attribute>
            <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
            <attribute name="FactoryRef">/XAConnectionFactory</attribute>
            <attribute name="QueueFactoryRef">/XAConnectionFactory</attribute>
            <attribute name="TopicFactoryRef">/XAConnectionFactory</attribute>
            <attribute name="Properties">
             java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
             java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
             java.naming.provider.url=jnp://10.2.22.68:1199
            </attribute>
         </mbean>

       

       

      The 'remoting-bisocket-service.xml' has not been changed and it is the same as the one shipped with JBoss 5.10. GA

       

       


        • 1. Re: Problem with the bridge reconnecting to remote topic.
          gaohoward

          Hi,

           

          Can you post your connection-factories-service.xml here? Thanks

           

          Howard

          • 2. Re: Problem with the bridge reconnecting to remote topic.
            abelinschi

            Here is the used 'connection-factories-service.xml':

             

             

             

             

             

            <?xml version="1.0" encoding="UTF-8"?>

             

            <!--
                 Messaging Connection Factories deployment descriptor.

             

                 $Id: connection-factories-service.xml 85945 2009-03-16 19:45:12Z dimitris@jboss.org $
            -->

             

            <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>
                 
                  <!- - Should acknowledgements be sent asynchronously? - ->
                 
                  <attribute name="SendAcksAsync">false</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>