Hi, 
I'm really don't understand why in very similiar situations, in one flow
doFinally is not called?
I have Camel setup with the following flows:

x > a > b > http
y > a > b > http

There is exception in http (camel) where is processed and handled(true).
It went back to x and flow is as follows:

       
from("jbi:service:http://ssg.sabre.com/lcc/1.0/XML2toOTAAdapterService";)
        .doTry()
                .to("bean:dataSetterProcessor?method=setInExchangeData")
                .convertBodyTo(String.class)
                .setProperty(bbb, constant("ccc"))
                .to("bean:propertiesSetterProcessor?cache=true")
                .to("xslt:aaa.xsl")
                .to("jbi:service:http://bla bla")
        .doCatch(Exception.class)
            .process(new Processor() {
                public void process(Exchange ex) throws Exception {
                    ex.setProperty(ddd, bbb);
                }           
            })
            .to(DIRECT_ERROR_PATH_ENDPOINT)
        .doFinally()
            .to(DIRECT_RESPONSE_PATH_ENDPOINT)
        .end();

And DIRECT_RESPONSE_PATH_ENDPOINT always called.

Flow y looks absolutely identical but doFinally is not called.
When I throw exception from the route directly - both catch and finnally are
called.

        from(ATB_ADAPTER_ENTRY_ENDPOINT)
        .doTry()
            .to("bean:dataSetterProcessor?method=setInExchangeData")
            .setProperty(aaa, constant("ccc"))
            .to("propertiesSetterProcessor")
            .to("bean:pssProcessor?method=processRequest")      
            .to("xslt:xxx.xslt")
            .to("bean:logProcessor?cache=true")
            .setProperty(zzz, constant(""))
            
            .process(new Processor() {
                public void process(Exchange ex) throws Exception {
                    throw new IllegalArgumentException("crazy");
                }
            })
              
            .to("jbi:service:http://bla bla")
        .doCatch(Exception.class)
              .process(new Processor() {
                  public void process(Exchange ex) throws Exception {
                      ex.setProperty(aaa, bbb);
                  }
              })
               .to(DIRECT_ATB_ERROR_PATH_ENDPOINT)
        .doFinally()
            .to(ADAPTER_RESPONSE_ROUTE_ENDPOINT)
        .end();

And ADAPTER_RESPONSE_ROUTE_ENDPOINT is NOT called if there was exception in
http and message was handled(true).


What may prevent doFinally() calling in success path, but with exchange
handled(true) by further flow?
Any flag I can check?
Very irritating because works for one flow, but not for another, identical
IMHO...

Camel 2.7

Thanks
Marek




--
View this message in context: 
http://camel.465427.n5.nabble.com/What-may-prevent-to-call-doFinally-tp5730705.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to