title: how to iterate through an arraylist inside apache camel route , xml?
body: <p>I want to iterate through a java arraylist passed as message header to a camel route via bean so that each string item which is basically an url can be passed as uri argument inside  tag in camel route.</p>
  
  <p>I am passing an array list as message header to camel route through java bean as follows</p>
  
  <pre><code>ArrayList&lt;String&gt; list=new ArrayList&lt;String&gt;();//Creating arraylist  
                list.add("http://www.google.com");//Adding object in arraylist  
                list.add("http://www.stackoverflow.com");  
                list.add("http://www.tutorialspoint.com");  
                list.add("http://localhost:8080/sampleExample/query"); 
                  exchange.getOut().setHeader("endpoints",list);
  </code></pre>
  
  <p>and, inside camel route i want to iterate through this list and retrieve each list item one by one so that i can pass these items in uri. here's my camel route:</p>
  
  <pre><code>&lt;route id="myroute"&gt;
          &lt;from id="sedp" uri="cxfrs:http://{{env:POC_HOST}}/{{env:POC_PATH}}"/&gt;
          &lt;log id="_log1" message="Received query request from consumers"/&gt;
          &lt;bean beanType="com.company.myapp.poc.logic.ProcessRequest"
              id="queryProcessor" method="checkRequestType"/&gt;
  
            // I want to iterate through the list here as &lt;toD uri="${header.endpoints.item}" /&gt;
  
  
      &lt;/route&gt;
  </code></pre>
  
  <p>But i am not able to iterate through each item in list recieved as header.endpoints inside camel route.</p>