Yes there is the method call

setHeader "foo" method(MyBean.class, "doSomething")

On Tue, Jan 24, 2017 at 4:39 PM, buyleg <[email protected]> wrote:
> Is it possible to manage the header with a bean instead of setHeader for each
> value?
> What I mean: Could you use replace the following:
> from("file://{{main.dir}}/1_CHECK_MD5/?include=.*voucher.xml&move=DONE&moveFailed=ERRORS/${file:name.noext}
> ${header.ErrorInFileName}.${file:ext}&sortBy=file:name")
>             .routeId("2_READ_VOUCHER_COPY_ZIP_ROUTE")
>             *.setHeader("Voucher", simple("${body}")) //Save Voucher
>             // Create business log
>             .setHeader("TransactionId",
> simple(UUID.randomUUID().toString()))
>             .setHeader("VoucherName", xpath("//metaData/voucherName/text()",
> String.class))
>             .setHeader("VoucherTimestamp",
> xpath("//metaData/timestamp/text()", String.class))
>             .setHeader("CbssBatchId",
> xpath("//metaData/uniqueIdentifier/text()", String.class))
>             .setHeader("FilenameNodeList",
> xpath("//packagedLotFiles/packagedLotFile/lotFileName/text()",
> NodeList.class))
>             .setHeader("FilenameList",
> method(XmlUtils.class,"nodeListToCSVString(${header.FilenameNodeList})"))*
>             .bean(BatchLog.class, "createBatchIn(${header.TransactionId},
> CBSS_FTP:{{sftpCbss.ip}}, ${header.VoucherName}, ${header.FilenameList}, 0,
> ${header.CbssBatchId}, "
>                     +"${header.VoucherTimestamp}, PROVICBSS,
> UPDATE_PERSON_DATA, {{main.applicationid}})")
>
> .setHeader(....) => in a custom bean
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/manage-headers-tp5793035.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to