2 Replies Latest reply on Oct 29, 2008 12:34 PM by Chris Sun

    SOAP onto the bus, persist synchronously and retrieve messag

    Chris Sun Newbie

      A client sends a SOAP message to a JBossWS endpoint on the bus. There the message is persisted with a classification e.g. "new". On success, the client receives a SUCCESS response. A (scheduled) service will retrieve all new Messages out of the store and process their bodies.
      A client must be sure that JBoss ESB will deliver the message even if it crashes (this is the reason for persisting).

      The following code snippets don't really work:

      @WebService(name = "LockingWS", targetNamespace="http://united/locking")
      public class LockingWS {
       public String lock(@WebParam(name="param1") String message) throws MessageDeliverException {
       Message esbMessage = SOAPProcessor.getMessage();
       if(esbMessage != null) {
       ServiceInvoker si = new ServiceInvoker("MyServiceCategory","PersistService");
       try {
       si.deliverSync(esbMessage, 1000);
       } catch (Exception e) {
       return "ERROR";
       return "SUCCESS";
       return "ERROR";

       <jms-provider name="JBossMQ"
       <jms-bus busid="quickstartGwChannel">
       <jms-message-filter dest-type="QUEUE"
       dest-name="queue/quickstart_webservice_producer_gw" />
       <jms-bus busid="quickstartEsbChannel">
       <jms-message-filter dest-type="QUEUE"
       dest-name="queue/quickstart_webservice_producer_esb" />
       <jbr-provider name="JBR-Http" protocol="http"
       <jbr-bus busid="Http-1" port="8765" />
       <service category="MyServiceCategory" name="MyWSProducerService"
       description="WS Frontend speaks natively to the ESB">
       <jbr-listener name="Http-Gateway" busidref="Http-1"
       is-gateway="true" />
       <jms-listener name="JMS-ESBListener"
       busidref="quickstartEsbChannel" />
       <action name="JBossWSAdapter"
       <property name="jbossws-endpoint" value="LockingWS" />
       <service name="PersistService" category="MyServiceCategory"
       description="persisitiert alle einkommenden Messages" invmScope="GLOBAL">
       <action name="PersistAction"
       <property name="classification" value="new" />
       <property name="message-store-class"
       value="org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl" />

      I think there is a better way to do this, but how?