spring - save camel messages between routes -
we use spring dsl define camel routes. in 1 case message headers disappear. our design requires audit trail debug issues, , prove messages moving designed. use , reference audit processor create message file name 2 headers, 1 constant, other unique variable. can't use setheader in case of variable one. here generic example includes commented attempts failed:
<route id="msg_in"> <from uri="direct:msg_in" /> <wiretap ref="audit" processorref="auditpreprocessor" /> <to uri="direct:to_json" /> </route> <route id="to_json"> <from uri="direct:to_json" /> <!-- below seemed have failed --> <!-- <setproperty propertyname="saveid"> --> <!-- <simple>${in.header.uniqueid}</simple> --> <!-- </setproperty> --> <bean ref="jdbcprocessor1" /> <!-- headers still exist here --> <bean ref="tojson1" /> <!-- headers still exist here, , wiretap on next line works --> <wiretap ref="audit" processorref="auditpreprocessor" /> <bean ref="tojson" /> <!-- message headers not here need set them again ? --> <setheader headername="hdr1"> <constant>update1</constant> </setheader> <!-- <setheader headername="uniqueid"> --> <!-- <simple>${exchangeproperty:saveid}</simple> ... didn't work --> <!-- <simple>${properties:saveid}</simple> ... didn't work --> <!-- </setheader> --> <to uri="direct:msg_out" /> </route> <route id="msg_out"> <from uri="direct:msg_out" /> <!-- try wiretap here no headers, saved file null-null , gets continually overwritten, no usable audit trail --> </route>
i spent considerable time trying find right way in spring xml, no luck yet.
thanks in advance if can help.