2 Replies Latest reply on Mar 28, 2011 11:45 AM by Julio Ortiz

    Incorrect doFinally() behaviour?

    Julio Ortiz Newbie

      Hi All,

      I need to print the response message going back to our application client. I chose to do it in the doFinally() section below right before the route is complete.

       

      What I noticed is that the first wiretap statement below prints the original request, whereas the second  one prints the actual response. Of course, I do not need two wiretap statements, but that's one way I've gotten around this unexpected behavior.

       

      Could someone comment if this is an incorrect behaviour or not?

       

      Thanks,

      Julio

       

      from ( sourceUri )

             .doTry()

                    .to(logEntry)

                    .to(initializeRequest)

                    .to(processRequest)

             .doCatch(java.lang.Exception.class)

                    .to(handleException)

             .doFinally()

                    .to("direct:finalizeRequest")

             .end()

      ;

       

      from ( "direct:finalizeRequest" )

             .wireTap("log:" + routeID + "_debug?level=DEBUG")

             .wireTap("log:" + routeID + "_exit?level=INFO")

      ;