Steve973 commented on code in PR #11906:
URL: https://github.com/apache/camel/pull/11906#discussion_r1385778185


##########
components/camel-dynamic-router/src/main/java/org/apache/camel/component/dynamicrouter/DynamicRouterEndpoint.java:
##########
@@ -140,30 +152,90 @@ protected void doInit() throws Exception {
         super.doInit();
         DynamicRouterComponent component = getDynamicRouterComponent();
         if (CONTROL_CHANNEL_NAME.equals(configuration.getChannel())) {
-            final DynamicRouterControlChannelProcessor processor = 
controlChannelProcessorFactorySupplier.get()
-                    .getInstance(component);
-            processor.setConfiguration(configuration);
             try {
                 // There can be multiple control actions, but we do not want to
                 // create another consumer on the control channel, so check to
                 // see if the consumer has already been created, and skip the
                 // creation of another consumer if one already exists
                 if (component.getControlChannelProcessor() == null) {
+                    DynamicRouterControlChannelProcessor processor = 
controlChannelProcessorFactorySupplier.get()
+                            .getInstance(component);
+                    processor.setConfiguration(configuration);
                     component.setControlChannelProcessor(processor);
                 }
             } catch (Exception e) {
                 throw new IllegalStateException("Could not create Dynamic 
Router endpoint", e);
             }
         } else {
-            final DynamicRouterProcessor processor = 
processorFactorySupplier.get()
-                    .getInstance("dynamicRouterProcessor-" + 
configuration.getChannel(), getCamelContext(),
-                            configuration.getRecipientMode(), 
configuration.isWarnDroppedMessage(),
-                            filterProcessorFactorySupplier);
-            ServiceHelper.startService(processor);
+            CamelContext camelContext = getCamelContext();
+            String routeId = configuration.getRouteId();
+            long timeout = configuration.getTimeout();
+            ErrorHandler errorHandler = new NoErrorHandler(null);
+            if (producerCache == null) {
+                producerCache = new DefaultProducerCache(this, camelContext, 
1000);
+            }
+            ExecutorService aggregateExecutorService = 
camelContext.getExecutorServiceManager()

Review Comment:
   Yes.  That was an odd oversight.  I cleaned it up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to