Re: How to evaluate an expression/substitute a variable for building URI's at runtime ?
Thanks Willem for the reply, but still i want to use the same routes that i have posted (without using a dataformat). Is it possible to evaluate the URI at runtime ? , somehow source the RSS URL to from() method. Thanks, Hussain -- View this message in context: http://camel.465427.n5.nabble.com/How-to-evaluate-an-expression-substitute-a-variable-for-building-URI-s-at-runtime-tp1618587p1713397.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to evaluate an expression/substitute a variable for building URI's at runtime ?
Thanks Willem for the replies. I have modified the routes a little bit , it may not be the right way to do but still it works. from("file://c:?fileName=rssUrl.txt&noop=true&readLock=none"). process(new Processor() { public void process(Exchange exchange) throws Exception { // read the file contents here } }).loop(nosOfTimes). split(body(String.class).tokenize(";")). delay(noOfSecs). process( new Processor() { public void process(Exchange arg0) throws Exception { { String rssUrl = (String)arg0.getIn().getBody(); if(logger.isInfoEnabled()) logger.info("Polling url :"+rssUrl); URL feedUrl = new URL(rssUrl); SyndFeedInput input = new SyndFeedInput(); SyndFeed feed = input.build(new XmlReader(feedUrl)); if(logger.isInfoEnabled()) logger.info("got feed:" +feed.getTitle()); arg0.getOut().setBody(feed); } }}). to("direct:processRssFeed"). end(); Thanks, Hussain http://www.impetus.com -- View this message in context: http://camel.465427.n5.nabble.com/How-to-evaluate-an-expression-substitute-a-variable-for-building-URI-s-at-runtime-tp1618587p1843098.html Sent from the Camel - Users mailing list archive at Nabble.com.
Slow startup of routes
Hi, I am using camel to implement dispatcher EIP. There are thousands of messages in a queue which needs to be delivered at different URLs. Each message has its own delivery URL and delivery protocol (ftp,email,http etc). The way we are implementing in Camel is - Boot a single camel context, the context is disabled for JMX and the loadStatisticsEnabled is set to false on the ManagementStrategy. As mentioned in a jira issue, addressed in 2.11.0 version, for disabling the background management thread creation. - For each message a route is being constructed , the message is being pushed to the route for delivery. - After the message is processed route is shutdown and removed from context. We did a small perf test by having 200 threads of dispatcher component, each sharing the same context. Observed that the time to start a route increases upto a maximum of 60 seconds while the time to process is in milliseconds. Issue CAMEL-5675 mentions that this has been fixed but we are still observing significant time being taken in starting up routes. Pls suggest, what should we do to solve this. The route that we are creating for http is from("direct:"+dispatchItem.getID()).toF("%s?httpClient.soTimeout=%s&disableStreamCache=true", dispatchItem.getEndPointURL(),timeOutInMillis); Each dispatchItem has a unique ID. Thanks, Hussain -- View this message in context: http://camel.465427.n5.nabble.com/Slow-startup-of-routes-tp5732356.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Slow startup of routes
Thanks Willem, I am not clear how can we use caching for component creation, please elaborate on it. Need to set the soTimeout per endpoint since each dispatch message contain its endpoint and timeOut settings. Thanks, Hussain -- View this message in context: http://camel.465427.n5.nabble.com/Slow-startup-of-routes-tp5732356p5732460.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Slow startup of routes
Thanks Claus for pointing out the mistake. Changed the design to have a single route per protocol and now using the dynamic EIP pattern to pass in the endpoint url and other parameters. The new route looks like : from("direct:http") .recipientList(simple("http:${header.url}? httpClient.soTimeout=${header.timeout}&disableStreamCache=true")); Thanks, Hussain -- View this message in context: http://camel.465427.n5.nabble.com/Slow-startup-of-routes-tp5732356p5732473.html Sent from the Camel - Users mailing list archive at Nabble.com.