I am trying to set camel Header value using below Expression
.setHeader("amqName").simple("${amqAddressMap.get(header.userTypeID)}", String.class)
where amqAddressMap is an array list and passing header value as argument but it shows invalid expression error
is there any way to execute the code without using using processor class
${amqAddressMap.get(${header.userTypeID})}amqAddressMapdeclared? My blind guess is it is your local java variable and you cannot do that, you can only access objects stored in Exchange. UsesetProperty("amqAddressMap", constant(amqAddressMap))and then you can refer it with${exchangeProperty.amqAddressMap.get(${header.userTypeID})}. And I am pretty sure that the exception message tells a bit more, than "invalid expression error"