You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Th...@telekom.de on 2019/12/16 14:26:20 UTC

useOriginalMessage at parallelProcessing

Hi, 

I still fiddling around with deadletter handling. 
I got a zip. This is splitted. When there is an error an exception is thrown. 
Then error handler (and the route) shall write the original file to dead letter dir. 
This works when I comment out the parallelProcessing. 
With parallelProcessing it did not write the original file to dead letter dir, but the xml.   

To be honest: this is annoying. 

I simply what to write the original input file (a zip) into dead letter directory in any cases 
where an exception is thrown. 
Even after aggregating later. 

Simple as that. 

Regards Thomas



errorHandler(deadLetterChannel("direct:deadletter").useOriginalMessage());

from("direct:deadletter")
    .to(String.format("file://%s", DEADDIRECTORY))

from(FILE_IN_URI).routeId(FILE_ROUTE_ID)
   .split(new ZipSplitter()).shareUnitOfWork()
          .streaming()
          .choice()
                 .when(simple("${in.header.CamelFileName} ends with 'xml'"))
                  .split(xpath("/ImgSendFax/Document"))//.parallelProcessing().shareUnitOfWork()
                      -> EXEPTION