'How to retrieve a exchange property in the camel route XML?

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.



Solution 1:[1]

you would have to use simple language instead of constant, and the correct syntax is ${properties:x}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Luca Mattia Ferrari