6 Replies Latest reply on Nov 19, 2012 10:44 AM by kconner

    No response message for RequestResponse mep

    jbuechel

      Hi all,

       

      I'm trying to implement an ESB which:

      - provides a webservice to system1

      - consumes either a webservice from system2 or system3 (content based routing)

      - sends back transformed response to system1

       

      All works fine without the content based routing (i.e. targeting only system2) having the following jboss-esb.xml:

       

      <?xml version="1.0"?>
      <jbossesb parameterReloadSecs="5"
                xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd">
      
        <providers>
          <jms-provider connection-factory="ConnectionFactory"
            name="JBossMQ">
      
            <jms-bus busid="esbChannel">
              <jms-message-filter
                dest-name="queue/quickstart_publish_as_webservice_Request_esb_4"
                dest-type="QUEUE" selector="serviceName='getEntityByKeyRequest'" />
            </jms-bus>
      
          </jms-provider>
      
        </providers>
      
        <services>
          <service category="wsa-ncinv"
            description="Webservice Agent to proxy communication between System1 and System2"
            name="getObjectByKeyRequest">
      
      
            <listeners>
              <jms-listener busidref="esbChannel" maxThreads="1"
                name="jmsListener" />
            </listeners>
      
            <actions faultXsd="/schema/wsa-ncinv-fault-v1-0.xsd" inXsd="/schema/wsa-ncinv-request-v1-0.xsd"
              mep="RequestResponse" outXsd="/schema/wsa-ncinv-response-v1-0.xsd"
              validate="true" webservice="true">
      
              <action class="org.jboss.soa.esb.actions.SystemPrintln" name="println: incoming request">
                <property name="message" value="Incoming request" />
              </action>
      
              <action class="consumer.ItsmRequestProcessor"
                name="custom: itsm request processor" />
      
              <action class="org.jboss.soa.esb.smooks.SmooksAction" name="smooks: transform request">
                <property name="smooksConfig" value="/transform/smooks-config-request.xml" />
              </action>
      
              <action class="org.jboss.soa.esb.actions.SystemPrintln" name="println: outgoing request">
                <property name="message" value="Outgoing request" />
              </action>
      
              <action class="org.jboss.soa.esb.actions.routing.http.HttpRouter"
                name="soap proxy: call nc-inv webservice">
                <property name="method" value="POST" />
                <property name="endpointUrl" value="http://localhost:8088/" />
              </action>
      
              <action class="org.jboss.soa.esb.actions.SystemPrintln" name="println: incoming response">
                <property name="message" value="Incoming response" />
              </action>
      
              <action class="org.jboss.soa.esb.smooks.SmooksAction" name="smooks: transform response">
                <property name="smooksConfig" value="/transform/smooks-config-response.xml" />
              </action>
      
              <action class="org.jboss.soa.esb.actions.SystemPrintln" name="println: transformed response">
                <property name="message" value="Transformed response" />
              </action>
      
              <action class="consumer.ItsmResponseProcessor"
                name="custom: itsm response processor">
                <property name="idElementName" value="ncoInstanceId" />
                <property name="idElementNamespace"
                  value="http://bla.com/xml/itsm-ncinv-wsagent/v1-0" />
              </action>
      
              <action class="org.jboss.soa.esb.actions.SystemPrintln" name="println: outgoing response">
                <property name="message" value="Outgoing Response" />
              </action>
      
            </actions>
          </service>
        </services>
      </jbossesb>
      
      

       

      If the routing (static routing for test purposes) will be defined, the log output shows "No response message for RequestResponse mep!"

       

      jboss-esb.xml with test routing:

      <?xml version="1.0"?>
      <jbossesb parameterReloadSecs="5"
                xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd">
      
        <providers>
          <jms-provider connection-factory="ConnectionFactory"
            name="JBossMQ">
      
            <jms-bus busid="esbChannel">
              <jms-message-filter
                dest-name="queue/quickstart_publish_as_webservice_Request_esb_4"
                dest-type="QUEUE" />
            </jms-bus>
      
            <jms-bus busid="esbChannel2">
              <jms-message-filter dest-name="queue/qConsumer"
                dest-type="QUEUE" />
            </jms-bus>
      
          </jms-provider>
        </providers>
      
        <services>
      
          <service category="wsa-ncinv"
            description=""
            name="getObjectByKeyRequest">
      
            <listeners>
              <jms-listener busidref="esbChannel" name="jmsListener" />
            </listeners>
      
            <actions faultXsd="/schema/wsa-ncinv-fault-v1-0.xsd" inXsd="/schema/wsa-ncinv-request-v1-0.xsd"
              mep="RequestResponse" outXsd="/schema/wsa-ncinv-response-v1-0.xsd"
              validate="true" webservice="true">
      
              <action class="org.jboss.soa.esb.actions.SystemPrintln" name="println: incoming request">
                <property name="message" value="Incoming request" />
              </action>
      
              <action class="com.frox.itsm.ncinv.consumer.ItsmRequestProcessor"
                name="custom: itsm request processor" />
      
              <action class="org.jboss.soa.esb.actions.StaticRouter" name="static"
                process="process">
                <property name="destinations">
                  <route-to destination-name="test" service-category="wsa-ncinv"
                    service-name="test" />
                </property>
              </action>
      
            </actions>
          </service>
      
          <service category="wsa-ncinv" description="test" name="test">
      
            <listeners>
              <jms-listener busidref="esbChannel2" is-gateway="false"
                maxThreads="1" name="jmsListener2" />
            </listeners>
      
            <actions mep="RequestResponse">
              <action class="org.jboss.soa.esb.actions.SystemPrintln" name="println: test">
                <property name="message" value="TEST-TEST" />
              </action>
            </actions>
      
          </service>
      
        </services>
      </jbossesb>
      
      

       

      Log output:

      13:47:27,903 INFO  [STDOUT] Incoming request: 
      13:47:27,903 INFO  [STDOUT] [<v1:getObjectByKeyRequest xmlns:v1="http://frox.com/xml/itsm-ncinv-wsagent/v1-0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
               <v1:ncoInstanceId>XX12E120524153kWmkTAPdQEAgFrYJ</v1:ncoInstanceId>
               <v1:objectId>AC3.456.123.986</v1:objectId>
               <v1:objectIdType>cfsInstanceIdKey</v1:objectIdType>
               <v1:inventoryType>CFS</v1:inventoryType>
            </v1:getObjectByKeyRequest>].
      13:47:27,908 WARN  [ActionProcessingPipeline] No response message for RequestResponse mep! To: JMSEpr [ PortReference < <wsa:Address jms:localhost:1099#queue/quickstart_publish_as_webservice_Request_esb_4/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:destination-name : queue/quickstart_publish_as_webservice_Request_esb_4/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:message-selector : serviceName='getEntityByKeyRequest'/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] ReplyTo: JMSEpr [ PortReference < <wsa:Address jms:localhost:1099#queue/quickstart_publish_as_webservice_Request_esb_4_reply/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:destination-name : queue/quickstart_publish_as_webservice_Request_esb_4_reply/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:message-selector : serviceName='getEntityByKeyRequest' AND jbossESBresponseUUID='23db1e23-e556-4752-bd03-8faafd6fa1a7'/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 91bbd5fb-ad3a-48f2-9ca8-5dd0b93f2e6d RelatesTo: jms:correlationID#91bbd5fb-ad3a-48f2-9ca8-5dd0b93f2e6d
      13:47:27,910 INFO  [STDOUT] TEST-TEST: 
      13:47:27,910 INFO  [STDOUT] [<v1:getObjectByKeyRequest xmlns:v1="http://frox.com/xml/itsm-ncinv-wsagent/v1-0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
               <v1:ncoInstanceId>XX12E120524153kWmkTAPdQEAgFrYJ</v1:ncoInstanceId>
               <v1:objectId>AC3.456.123.986</v1:objectId>
               <v1:objectIdType>cfsInstanceIdKey</v1:objectIdType>
               <v1:inventoryType>CFS</v1:inventoryType>
            </v1:getObjectByKeyRequest>].
      
      

       

      How can be made sure the response is sent back to the originating service?

       

      Any advice would be very appreciated.

       

      Kind regards,

      Jonas

        • 1. Re: No response message for RequestResponse mep
          kcbabo


          StaticRouter and ContentBasedRouter terminate the action pipeline, which explains why you are not seeing a reply message.  Take a look at the Routers section in the Programmer's Guide and the Content Based Routing section of the Services Guide for more background.

          • 2. Re: No response message for RequestResponse mep
            jbuechel

            Thank you for your help.

             

            I understand that the action pipeline has been terminated. (I read that chapters, acutally.)

             

            But I don't understand, how is the response getting back to the client then at all? (Sorry, this might be lacking general knowledge about JBossESB.)

            • 3. No response message for RequestResponse mep
              kcbabo

              Let's say you have a service 'A'.  In the action pipeline for service 'A', you would like to call service 'B' and use the response from 'B' as the reply for service 'A'.   Is this what you are looking for?  If so, then using SyncServiceInvoker or writing your own action class which uses ServiceInvoker are two options.  This assumes you need a synchronous response to the client for service 'A'.  If that's not required, then you can post back to a reply queue, HTTP endpoint, etc. as part of the service 'B' pipeline.

               

              hth,

              keith

              • 4. No response message for RequestResponse mep
                jbuechel

                Indeed this helps to understand better! Thank you Keith.

                 

                In the action pipeline for service 'A', you would like to call service 'B' and use the response from 'B' as the reply for service 'A'.   Is this what you are looking for?

                Exactly.

                 

                How would I then integrate a routing? Let's say, service 'A' calls either service 'B' or service 'C'.

                 

                For now I implemented a custom action which sends a request either to webservice1 or webservice2 based on the message content. The response is then passed on in the action pipeline.

                 

                Regards,

                Jonas

                • 5. Re: No response message for RequestResponse mep
                  crizom85

                  so there is NO "2-way" router in ESB (im on esb 4.10)? i mean a router that for example send the request to a service and get back the response to the main service?

                  • 6. Re: No response message for RequestResponse mep
                    kconner

                    Take a look at SyncServiceInvoker.