camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "naveen.palle" <>
Subject Building Camel Dynamic router getting after properties from Database
Date Tue, 17 Nov 2015 06:08:52 GMT

I am currently working on dynamic camel route builder for each customer. I
am getting customer information form database.  My route : 

public class RouteAllCust extends SpringRouteBuilder{

	public String dataSource;
	public void configure() throws Exception {
		.to("sql:select * from PropertiesTable where keytext like
		.process(new CustomerProcessor())
			.process(new IndivisualCustomerProcessor())
			.to("quartz://timerName" + "${in.header.cid}" + 
"?${in.header.cornExpression}").routeId("Cron Scheduler Route "+

	public String getDataSource() {
		return dataSource;

	public void setDataSource(String dataSource) {
		this.dataSource = dataSource;
I have injected dataSource form spring config.

CustomerProcessor : 
public class CustomerProcessor implements Processor {
	public void process(Exchange exchange) throws Exception {"Getting customer list map");
		List<Map&lt;String, Object>> customerList = (List<Map&lt;String, Object>>)
		exchange.getIn().setHeader("customers", customerList);"Customer list size : " + cust.size());


IndivisualCustomerProcessor :

public class IndivisualCustomerProcessor implements Processor{

	private static final Logger logger =
	public void process(Exchange exchange) throws Exception {
		//"Getting Indivisual Customer ");
		Customer c = (Customer) exchange.getIn().getBody(Customer.class);
		if(c.getcId() != null)	{
			Map<String, Object> headerMap = new HashMap<String, Object>();
			headerMap.put("cid", c.getcId());
			headerMap.put("ccode", c.getCustomerCode());
			headerMap.put("reportsubscription", c.getReportSubscription());
			headerMap.put("customerprofile", c.getCustProfile());
			headerMap.put("cornExpression", c.getCustProfile());
		else{"Can not process this customer. Customer id is null. " +
		}"Processing of Customer id   : " + c.getcId() + " - " +

Where I am setting customer properties in the header. These properties are
used to create route for each customer.

I am getting following error : 

Failed to resolve endpoint:
due to: There are 1 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown parameters=[{${in.header.cornExpression}=}]

I have used header("cornExpression") instead of ${in.header.cornExpression}.
I am getting same error message.

Can anyone help me to fix the issue.

Thank you

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

View raw message