org.apache.camel.DynamicRouter dynamicRouterAnnotation =
(org.apache.camel.DynamicRouter)collectedMethodAnnotation.get(org.apache.camel.DynamicRouter.class);
if (dynamicRouterAnnotation != null
&& matchContext(dynamicRouterAnnotation.context())) {
dynamicRouter = new DynamicRouter(camelContext);
dynamicRouter.setDelimiter(dynamicRouterAnnotation.delimiter());
dynamicRouter.setIgnoreInvalidEndpoints(dynamicRouterAnnotation.ignoreInvalidEndpoints());
// add created dynamicRouter as a service so we have its lifecycle managed
try {
camelContext.addService(dynamicRouter);