我有一个骆驼路线,它有一个步骤,它调用一个子路径将身体的文本部分转换为PDF。不幸的是,camel-pdf没有保留标头。有什么方法可以在不丢失当前交换的情况下获得子路由的值?
支线
from("seda:generate-pdf")
// Back up the original in a header
.setHeader("original", body())
// Create the PDF
.to("pdf:create?textProcessingFactory=autoFormatting")
// UHOH! All my headers are gone :(
// Set the PDF as the header for the doc server
.setHeader("pdf", body())
// Move the indicator back to the body
.setBody(header("original")) // <-- this no longer exists主干线
// Snip
// Unmarshal into Java
.unmarshal().json(JsonLibrary.Gson, MyReportContainingText.class)
// Call sub-route to generate the PDF
.inOut("seda:generate-pdf")
// UHOH! All my headers are gone :(
// Snip发布于 2016-09-12 21:20:04
而不是将内容保存在标题中,当您从一条路由传递到另一条路由时,可以将其删除,而是将它们保存为exchange属性。例如:
.setProperty("pdf", body())
.setProperty("pdf", simple("${body}")只要交换存在,交换属性就存在。
https://stackoverflow.com/questions/39458147
复制相似问题