camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Copernico <>
Subject Camel Velocity pass ArrayList
Date Thu, 27 Aug 2015 17:17:39 GMT

I have a velocity template for send an email. In this template i send to our
clients a list of items (JPA Entities) as an arraylist (is a result of a
query which size may be diferent each time)

Dear ${}

You request ${headers.itemList.size} items

#foreach(${item} in ${headers.itemList})
 Item ${item.description} - ${item.price}          

With Java DSL i put the headers

exchange.getIn().setHeader("name", client.getName());
exchange.getIn().setHeader("itemList", itemList());

But the testing email i receive, does not have the items list from the
arraylist (the foreach loop is not working) and camel is not replacing

Dear George

The items

You request ${headers.itemList.size} items

Any Ideas? How i pass objects like a pojo, a jpa entity, an arraylist to the
velocity template and access to their properties?


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message