Ich habe mehrere camelContexte erstellt und möchte, dass jeder camelContext seinen eigenen Threadpool verwendet. Das Logbuch zeigt aber an, dass alle meine camelContexts denselben Threadpool verwenden. Was vermisse ich?Threadpool-Konfiguration im Camel Context
Haupt Kamel Kontext
<camelContext id="routeLoader_route">
(no threadpool defined)
<route id="RouteCreator" >
<from uri="file://jsonFilePath" />
<bean ref="routeMonitor" method="loadJsontoCreateRoute" />
</route>
(some other routes defined)
</camelContext>
Die Methode "loadJsontoCreateRoute" drei json-Dateien lesen und dann drei Routen erstellen von
- Endpunkt "file: // xxx1/out" verbinden zum Endpunkt "direct-vm: out.test"
- Endpunkt "file: // xxx2/out" zum Endpunkt "direct-vm: out.test"
- e ndpoint "file: // xxx3/out" bis zum Endpunkt "direct-vm: out.test"
Ein weiterer Kamel Kontext
<camelContext id="test_out_route">
<threadPoolProfile id="outTestThreadPoolProfile" defaultProfile="true" poolSize="1" maxPoolSize="1" maxQueueSize="1000" rejectedPolicy="CallerRuns"/>
<route id="outboundTestingRouter">
<from uri="direct-vm:out.test"/>
<doTry>
<log message="Outbound Test -- START" loggingLevel="INFO" />
<recipientList>
<method ref="outTestBean" method="dynamicRoute" />
</recipientList>
<doFinally>
<log message="Outbound Test-- END" loggingLevel="INFO" />
<stop/>
</doFinally>
</doTry>
</route>
(Some other routes defined)
</camelContext>
Die dynamicRoute Methode ein uri für FTP-Komponente zurück
Log
20160623 09:48:04.297 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.524 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.526 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.527 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.634 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.636 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.652 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.653 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.749 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.749 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.827 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.827 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.890 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.937 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.937 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.999 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:05.140 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:05.358 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:05.358 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:05.469 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:05.471 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:05.593 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:05.905 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:05.999 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- END
Linie 3 10 das Protokoll zeigt die Linie, dass es mehr als 1 outboundTestingRouter Route ist gleichzeitig ausgeführt wird, während mein Thread outTestThreadPoolProfile Poolgröße ist begrenzt 1
Dies zeigt an, dass der Thread outTestThreadPoolProfile durch nicht outboundTestingRouter Route verwendet wird
Was Ich möchte ist die max zu begrenzen. Anzahl der gleichzeitigen Nutzung der Route OutboundTestingRouter.
Ich habe die Threadpoolgröße und das Protokoll bearbeiten, um zu erklären, warum ich denke, dass der Threadpool nicht verwendet wird. – hk6279
Versuchen Sie es mit der Threadpool-Regelsyntax und stellen Sie den Dienst-Executor manuell bereit. –
Nach dem Hinzufügen des threadpool -Tags in outboundTestingRouter route funktioniert es. Ich denke, die Direct-VM-Komponente verwendet den Anrufer-Thread, deshalb kann ich nicht sehen, dass der Threadpool funktioniert. – hk6279