2 Replies Latest reply on Feb 1, 2011 9:51 AM by Xiaoqing Zhu

    SMX4 JBI Clustering with JMS Broker Network - HOWTO

    Xiaoqing Zhu Newbie

      I am trying to configure a SMX 4 (fuse 4.3.0-03-00) cluster using ActiveMQ broker network. After researching various posts here's what I did:

       

      1) created active/standby hub brokers with the following transport connector:

       

               

       

         

        • Both use the same WSDL. I could just put an CXF SE as a service provider but the scenario is to proxy an external service in a cluster.

       

      4) On fac2-esb, deployed the consumer binding component with the following configuration:

       

          <cxfbc:consumer wsdl="classpath:wsdl/person.wsdl"

              useJBIWrapper="false" service="messaging:PersonService" endpoint="jms"

              targetService="messaging:PersonService" targetEndpoint="soap">

              <!-- interceptors omitted -->

          </cxfbc:consumer>

       

          <jms:destination name="jms.jms-destination" />

       

           

       

         

        • The component uses JMS port configuration from the WSDL.

       

       

      When I send SOAP request over JMS to fac2-esb, it receives and invokes the CXFBc, but then the following error is thrown:

       

      12:29:24,331 | WARN  | tenerContainer-1 | CxfBcComponent                   | ommon.endpoints.ConsumerEndpoint  184 | 95 - servicemix-common - 2010.02.0.fuse-02-00 | Target service (PersonService) and endpoint (soap) specified, but no matching endpoint found.  Only the service will be used for routing.

       

      ...

       

      12:29:24,342 | WARN  | tenerContainer-1 | PhaseInterceptorChain            | ache.cxf.common.logging.LogUtils  369 |  -  -  | Interceptor for PersonService#GetPerson has thrown exception, unwinding now

      org.apache.cxf.interceptor.Fault: Could not dispatch exchange. No matching endpoints.

       

       

      YET, it is clear that the PersonService#soap endpoint was advertised in the advisory topic, as I can 'steal' it from the 'ActiveMQ.Advisory.Consumer.Queue.org.apache.servicemix.jbi.cluster' topic off the fac2-esb broker:

       

      2011-01-31 12:08:43,092 INFO  gov.faa.swim.prototype.messaging.jms.pubsub.Consumer -

      Got message: ActiveMQMessage {commandId = 0, responseRequired = false,

      messageId = ID:hub2-36507-1296489688691-1:1:0:0:194, originalDestination = null,

      originalTransactionId = null, producerId = ID:hub2-36507-1296489688691-1:1:0:0,

      destination = topic://ActiveMQ.Advisory.Consumer.Queue.org.apache.servicemix.jbi.cluster,

      transactionId = null, expiration = 0, timestamp = 0, arrival= 0,

      brokerInTime = 1296493723023, brokerOutTime = 1296493723023, correlationId= null,

      replyTo = null, persistent = false, type = Advisory, priority = 0, groupID = null,

      groupSequence = 0, targetConsumerId = null, compressed = false, userID = null,

      content = null, marshalledProperties = org.apache.activemq.util.ByteSequence@18ddc48,

      dataStructure = ConsumerInfo {commandId = 32, responseRequired = false,

      consumerId = ID:hub2-36507-1296489688691-6:2:1:7,

      destination = queue://org.apache.servicemix.jbi.cluster, prefetchSize = 1000,

      maximumPendingMessageLimit = 0, browser = false, dispatchAsync = true,

      selector = (JBIMessage = 0 AND (JBIInterface IN

      ('{http://docs.oasis-open.org/wsn/brw-2}PublisherRegistrationManager',

      'Person',

      'CreatePullPoint',

      'NotificationBroker')

      OR JBIService IN ('Publisher',

      'CreatePullPoint',

      'NotificationBroker',

      'PersonService')

      OR JBIEndpoint IN ('{{http://servicemix.org/wsnotification}Publisher}Anonymous',

      '{{http://swim.faa.gov/prototype/messaging}PersonService}soap',

      '{{http://servicemix.org/wsnotification}NotificationBroker}Broker',

      '{{http://servicemix.org/wsnotification}CreatePullPoint}Broker')))

      OR ClusterName ='fac1-esb', subscriptionName = null, noLocal = false,

      exclusive = false, retroactive = false, priority = 0, brokerPath =

      ID:hub1-40575-1296493673615-2:1, ID:hub1-51626-1296490895255-0:1,

      optimizedAcknowledge = false, noRangeAcks = false,

      additionalPredicate = org.apache.activemq.command.NetworkBridgeFilter@19478c7},

      redeliveryCounter = 0, size = 0, properties =

      {originBrokerId=ID:hub2-36507-1296489688691-0:1,

      consumerCount=2, originBrokerName=default, originBrokerURL=tcp://hub2:61616},

      readOnlyProperties = true, readOnlyBody = true, droppable = false}

       

      I must have missed something very simple...any help will be much apprieciated!!

       

      Edited by: zhuxiaoqing on Jan 31, 2011 6:09 PM

       

      Edited by: zhuxiaoqing on Jan 31, 2011 7:16 PM

        • 1. Re: SMX4 JBI Clustering with JMS Broker Network - HOWTO
          Freeman(Yue) Fang Master

          Hi,

           

          Your working flow across JBI instances is cxfbc consumer(fac2-esb)----> cxf bc provider(fac1-esb), right?

          If so, you need register cxfbc consumer with OsgiSimpleClusterRegistration.

           

          Freeman

          • 2. Re: SMX4 JBI Clustering with JMS Broker Network - HOWTO
            Xiaoqing Zhu Newbie
            it said:
            ffang wrote:

            Hi,

             

            Your working flow across JBI instances is cxfbc consumer(fac2-esb)----> cxf bc provider(fac1-esb), right?

            If so, you need register cxfbc consumer with OsgiSimpleClusterRegistration.

             

            Freeman

             

            That worked wonders! I guess I misread the following blog:

             

            http://trenaman.blogspot.com/2010/04/four-things-you-need-to-know-about-new.html

             

            >

            >Cluster the endpoint the sends to the NMR, not the endpoint that receives (this is counter-intuitive!)

            >Second, cluster the producer, not the consumer. You would think that 'clustering' would involve some kind of configuration for each of the replicated endpoints 'listening' on the NMR. However, in the SMX 4 implementation, it goes the other way. You need to cluster the endpoint that's putting the information onto the NMR.

             

            In my example flow, the endpoint on fac2-esb (the cxfbc:consumer) IS a consumer endpoint, right? It consumes service from the NMR where the endpoint on fac1-esb (the cxfbc:provider) provides service to the NMR. Or is this not how NMR provider/consumers are defined?