问题
I have to run a loop in the route. my route looks as
<camel:loop>
<camel:constant>${property.x}</camel:constant>
</camel:loop>
My processor looks as
Date date = new Date();
this.LOGGER
.info("\n****WELCOME TO THE REQUEST OF CHECK PROCESSOR**");
int y=4;
Integer a=new Integer(y);
exchange.setProperty(x,a);
int k=(Integer) exchange.getProperty(x);
this.LOGGER
.info("\n***WELCOME TO THE REQUEST OF CHECK PROCESSOR ENDINGGGGGGGG***"+"a= "+a+" Y= "+y+" x= "+exchange.getProperty(x)+" k= "+k);
while running this the value of x= 4.I want to access this x in the camel route XML file.
回答1:
A good idea is to spend a bit time on the Camel website to find what you ask. See the exchangeProperty
: http://camel.apache.org/exchangeproperty.html
来源:https://stackoverflow.com/questions/41712421/how-to-retrieve-a-exchange-property-in-the-camel-route-xml