3 Replies Latest reply on Apr 4, 2008 4:59 AM by tfennelly

    Problem Accesing multiple Service

    rajib_pc

      My jboss-esb.xml is like below.

      <jbossesb parameterReloadSecs="5" xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
       <providers>
       <jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" jndi-URL="localhost">
       <jms-bus busid="troubleTicketEsbChannel">
       <jms-message-filter dest-name="/queue/TroubleTicketPOC_esb" dest-type="QUEUE"/>
       </jms-bus>
       </jms-provider>
       </providers>
       <services>
       <service category="CreateTroubleTicketService" name="TroubleTicketCreate_esb" description="Create Trouble Ticket Consumer">
       <listeners>
       <jms-listener name="JMS-ESBListener" busidref="troubleTicketEsbChannel" maxThreads="20" is-gateway="false"/>
       </listeners>
       <actions>
       <action name="request-mapper" class="com.wipro.poc.troubleticket.action.TroubleTicketProcessRequestAction" process="processTroubleTicket"/>
       <action name="soapui-client-action" class="org.jboss.soa.esb.actions.soap.SOAPClient">
       <property name="wsdl" value="http://127.0.0.1:8090/TroubleTicket_POC?wsdl"/>
       <property name="responseAsOgnlMap" value="true"/>
       <property name="SOAPAction" value="createTroubleTicketByValue"/>
       </action>
       <action name="response-mapper" class="com.wipro.poc.troubleticket.action.MyResponseAction"></action>
       </actions>
       </service>
       <service category="DisplayTroubleTicketService"
       name="TroubleTicketDisplay_esb" description="Display Trouble Ticket Consumer">
       <listeners>
       <jms-listener name="JMS-ESBListener"
       busidref="troubleTicketEsbChannel" maxThreads="20"
       is-gateway="false">
       </jms-listener></listeners>
       <actions>
       <action name="request-mapper" class="com.wipro.poc.troubleticket.action.TroubleTicketProcessRequestAction" process="processTroubleTicket"/>
       <action name="soapui-client-action" class="org.jboss.soa.esb.actions.soap.SOAPClient">
       <property name="wsdl" value="http://127.0.0.1:8090/TroubleTicket_POC?wsdl"></property>
       <property name="responseAsOgnlMap" value="true"></property>
       <property name="SOAPAction" value="getTroubleTicketsByKeys"></property></action>
       <action name="response-mapper" class="com.wipro.poc.troubleticket.action.MyResponseAction"></action></actions>
       </service>
       <service category="UpdateTroubleTicketService"
       name="TroubleTicketUpdate_esb" description="Display Trouble Ticket Consumer">
       <listeners>
       <jms-listener name="JMS-ESBListener"
       busidref="troubleTicketEsbChannel" maxThreads="20"
       is-gateway="false">
       </jms-listener></listeners>
       <actions>
       <action name="request-mapper" class="com.wipro.poc.troubleticket.action.TroubleTicketProcessRequestAction" process="processTroubleTicket"/>
       <action name="soapui-client-action" class="org.jboss.soa.esb.actions.soap.SOAPClient">
       <property name="wsdl" value="http://127.0.0.1:8090/TroubleTicket_POC?wsdl"></property>
       <property name="responseAsOgnlMap" value="true"></property>
       <property name="SOAPAction" value="setTroubleTicketByValue"></property></action>
       <action name="response-mapper" class="com.wipro.poc.troubleticket.action.MyResponseAction"></action></actions>
       </service>
       </services>
      </jbossesb>

      but when I calling ServiceInvoker using any Category & Service Name. Its not executing the proper SOAPAction, its executing by order.

      Suppose I Executing
      ServiceInvoker deliveryAdapterDisplay = new ServiceInvoker("DisplayTroubleTicketService", "TroubleTicketDisplay_esb");
      
      Message requestMessage = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
      
      requestMessage.getBody().add(xmlString);
      
      Message replyMessage = deliveryAdapterDisplay.deliverSync(requestMessage,20000);


      Its invoking 1st createTroubleTicketByValue, then if I resubmit again its executing getTroubleTicketsByKeys.

      if I resubmit again the same action, its executing setTroubleTicketByValue.

      So its executing by order irespective of the ServiceInvoker call.

      Please help me out if I am writing the jboss-esb.xml not properly.

        • 1. Re: Problem Accesing multiple Service
          tfennelly

          OK, this makes sense (from looking at your configuration). You have 3 services listening on the same JMS queue, so even though you're asking the ServiceInvoker to send a message to "A", this message could as easily be picked up by "B" or "C" because they're listening on the same channel.

          Under the hood, the ServiceInvoker looks up the available endpoints for "A", finds the JMS Queue and routes the message to it. B and C are also listening on this queue.

          • 2. Re: Problem Accesing multiple Service
            rajib_pc

            So I need to create jms-bus for each WebMethod?
            There is only service is running.

            • 3. Re: Problem Accesing multiple Service
              tfennelly

              So you have 3 ESB declarations in the above config. They're all listening on the same queue. You either need to add service specific filters, or just define 3 JMS endpoints in the provider section (also need to deploy the physical JMS endpoints) and configure each service to listen on its own queue (jms-bus).