0 Replies Latest reply on Mar 29, 2012 12:08 PM by Fabricio González

    How to send a response to the invoker of a service without reaching the end of the pipeline

    Fabricio González Newbie

      Hi, I have 2 custom actions exectuting one after the other in the same service like this


          <actions mep="RequestResponse">

              <action name="ActionA" class="ClassA"/>

              <action name="ActionB" class="ClassB"/>



      Suppose that ActionA does some validations over the received msg. If the validations found that the msg is invalid, how does you send a response to the invoker about that failure?



      Right now in my actions I set the response in the message at ActionA and put a mark in it indicating that I found an error in ActionA and ActionB checks for that mark before executing its code. I found this method useful but a burden because all of my actions have to start with:



          if (!markIspressent) {

              //Code goes here


          return message.



      I have tried setting the response msg at ActionA and returning `null` to stop the pipeline but that isn't working. I also tried another method that I found of throwing an `ActionProcessingFaultException(message,"SomeTextGoesInHere")` but that also isn't working.

      My main problem with this second one is that the ESB tries to reprocess the msg that thrown that exception and I don't see the response that I set into message until the ESB gives up and sends it back. But that giving up takes up to 60s.



      So my question is how can you send a response msg to the invoker before reaching up the end of the service pipeline.