You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ychawla <pr...@gmail.com> on 2015/03/16 20:01:29 UTC
Camel route - autostartup - no endpoint found
Hello All,
I have a route with autoStartup set to 'false'. However, Camel will still
try to resolve the endpoint in the 'from' URI on the route. For example:
<camel:route id="myRoute" autoStartup="false">
<from uri="myCXFServiceEndpoint"/>
However, I don't have 'myCXFServiceEndpoint' defined because the Spring
profile that I am using does not define that bean. There is a JIRA right
now to not pre-warm/start the route:
https://issues.apache.org/jira/browse/CAMEL-5695
which is discussed in this thread:
http://camel.465427.n5.nabble.com/autoStartup-and-Endpoints-td5718204.html
I was thinking that I could use the route policy that is referenced in this
thread, however, the exception is thrown before I can get at the route. For
example, overriding this method doesn't have any effect:
@Override
public void onInit(Route route)
{
LOG.info("Route Init for" + route.getId());
}
Is there any technique that I can use to tell Camel that when I set
autoStartup to 'false' that I don't want it to try to resolve the 'from'
endpoint? I can't think of any tricks offhand and am not able to do so with
a route policy. I do have CamelContext autostartup to false and am manually
only starting the routes that I will be using.
Any help is most appreciated!
Thanks,
Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-autostartup-no-endpoint-found-tp5764230.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel route - autostartup - no endpoint found
Posted by ychawla <pr...@gmail.com>.
I tried injecting a Camel Context into the Route Policy, but it looks like
the route isn't yet created so it can't be deleted:
@Override
protected void doStart() throws Exception {
LOG.info("In custom do start");
boolean removed = camelContext.removeRoute("myServiceRoute");
LOG.info("Removed route" + removed);
}
Any other ideas? Is it possible to conditionally import a route context
based on a Spring profile?
Thanks,
Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-autostartup-no-endpoint-found-tp5764230p5764231.html
Sent from the Camel - Users mailing list archive at Nabble.com.