#java #apache-camel #java-threads #camel-http
#java #apache-camel #java-потоки #camel-http
Вопрос:
В нашем проекте у нас есть контекст camel (2.23.1), и в определенных ситуациях мы хотели бы немедленно завершить контекст и все его маршруты. Для этого у нас есть следующий код:
private void stopContextImmediately(CamelContext context) throws ExecutorException {
try {
ShutdownStrategy shutdownStrategy = context.getShutdownStrategy();
shutdownStrategy.setTimeUnit(TimeUnit.MILLISECONDS);
shutdownStrategy.setTimeout(1);
shutdownStrategy.setShutdownNowOnTimeout(true);
context.setShutdownStrategy(shutdownStrategy);
for (Route route : context.getRoutes()) {
System.out.println("context.stopRoute: " route.getId()
" - " route.getDescription());
context.stopRoute(route.getId(), 1, TimeUnit.MILLISECONDS,
false);
}
context.stop();
} catch (Exception e) {
error("Can''t stop camel for file {0} in archive {1}", e);
}}
Но после запуска корректного завершения работы с таймаутом в 1 миллисекунду мы получаем предупреждение:
_Timeout произошел во время корректного завершения работы. Принудительное завершение работы маршрутов сейчас. Обратите внимание: некоторые ресурсы могут все еще выполняться, поскольку корректное завершение работы не завершилось успешно.
Мы замечаем, что все еще существует поток, запущенный с, в этом случае содержит задание нашего http-компонента, который пытается отправить http post с шаблоном повтора. (см. stacktrace ниже)
Вопрос: Как мы можем принудительно завершить запущенные маршруты и его потоки? (мы также хотим предотвратить завершение работы всего Java-приложения, SIGTERM не вариант)
2019-02-13 14:39:27.979 [:] [restartedMain ] INFO oyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"]
2019-02-13 14:39:27.996 [:] [restartedMain ] INFO mbedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path ''
2019-02-13 14:39:27.998 [:] [restartedMain ] INFO m.unit.u4ip.gmp.CamelApplication - Started CamelApplication in 5.461 seconds (JVM running for 6.91)
2019-02-13 14:39:28.009 [:] [restartedMain ] DEBUG oot.devtools.restart.Restarter - Creating new Restarter for thread Thread[main,5,main]
2019-02-13 14:39:28.009 [:] [restartedMain ] DEBUG oot.devtools.restart.Restarter - Immediately restarting application
2019-02-13 14:39:28.009 [:] [restartedMain ] DEBUG oot.devtools.restart.Restarter - Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@4316e59b
2019-02-13 14:39:28.010 [:] [restartedMain ] DEBUG oot.devtools.restart.Restarter - Starting application com.s.sdd.abv.CamelApplication with URLs [file:/C:/development/code/workspace-idea/gmp-project/gmp/target/classes/]
2019-02-13 14:39:28.435 [:] [on(2)-10.0.75.1] INFO rBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-02-13 14:39:28.435 [:] [on(2)-10.0.75.1] INFO .web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
2019-02-13 14:39:28.449 [:] [on(2)-10.0.75.1] INFO .web.servlet.DispatcherServlet - Completed initialization in 14 ms
2019-02-13 14:39:34.857 [490f8c58da7accf9:] [ntExecutorGroup] INFO curity.m2m.AccessTokenProvider - Fetching access token for scopes "ik" from "https://url.com/identity/connect/token"
2019-02-13 14:39:36.260 [490f8c58da7accf9:] [pool-2-thread-1] INFO converter.DefaultTypeConverter - Type converters loaded (core: 195, classpath: 41)
2019-02-13 14:39:36.264 [490f8c58da7accf9:] [pool-2-thread-1] INFO camel.impl.DefaultCamelContext - Apache Camel 2.23.1 (CamelContext: camel-2) is starting
2019-02-13 14:39:36.264 [490f8c58da7accf9:] [pool-2-thread-1] INFO ment.ManagedManagementStrategy - JMX is enabled
2019-02-13 14:39:36.292 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'ConvertBodyTo[java.lang.String]'
2019-02-13 14:39:36.297 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'SetBody[simple{${body.replaceAll("(|)", "")}}]'
2019-02-13 14:39:36.302 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'Unmarshal[org.apache.camel.model.dataformat.XmlJsonDataFormat@62a53f37]'
2019-02-13 14:39:36.310 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'SetHeader[CamelHttpUri, constant{https://www7.aeat.es/wlpl/SSII-FACT/ws/fr/SiiFactFRV1SOAP}]'
2019-02-13 14:39:36.313 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'SetHeader[CamelHttpUri, constant{https://www.aeat.es/wlpl/SSII-FACT/ws/fr/SiiFactFRV1SOAP}]'
2019-02-13 14:39:36.314 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'Choice[[When[xpath{XPath: /root/e/TestMessage} -> [SetHeader[CamelHttpUri, constant{https://www7.aeat.es/wlpl/SSII-FACT/ws/fr/SiiFactFRV1SOAP}]]]] Otherwise[[SetHeader[CamelHttpUri, constant{https://www.aeat.es/wlpl/SSII-FACT/ws/fr/SiiFactFRV1SOAP}]]]]'
2019-02-13 14:39:36.323 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'To[xslt:xslt/requestInvoicesReceived.xsl]'
2019-02-13 14:39:36.325 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'SetProperty[SoapRequestBody, simple{${body}}]'
2019-02-13 14:39:36.327 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'To[direct:http-call-route]'
2019-02-13 14:39:36.328 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'To[xslt:xslt/concatSoapRequestResponse.xsl]'
2019-02-13 14:39:36.329 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'SetHeader[certHeaderName, constant{test1}]'
2019-02-13 14:39:36.331 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'SetHeader[Content-Type, constant{text/xml; charset=utf-8}]'
2019-02-13 14:39:36.345 [490f8c58da7accf9:] [pool-2-thread-1] INFO .component.http4.HttpComponent - Created ClientConnectionManager org.apache.http.impl.conn.PoolingHttpClientConnectionManager@65b98b52
2019-02-13 14:39:36.349 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'To[https://localhost?aliasHeader=certHeaderNameamp;socketTimeout=5000amp;connectTimeout=5000amp;connectionRequestTimeout=5000]'
2019-02-13 14:39:36.350 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG sor.interceptor.DefaultChannel - Initialize channel for target: 'ConvertBodyTo[java.lang.String]'
2019-02-13 14:39:36.351 [490f8c58da7accf9:] [pool-2-thread-1] INFO camel.impl.DefaultCamelContext - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2019-02-13 14:39:36.357 [490f8c58da7accf9:] [pool-2-thread-1] INFO camel.builder.xml.XPathBuilder - Created default XPathFactory org.apache.xpath.jaxp.XPathFactoryImpl@48dacf4f
2019-02-13 14:39:36.840 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG .processor.DefaultErrorHandler - Using ExecutorService: org.apache.camel.util.concurrent.SizedScheduledExecutorService@20f78b0a[ErrorHandlerRedeliveryTask] for redeliveries on error handler: DefaultErrorHandler[InstrumentProcessorAdvice]
2019-02-13 14:39:36.840 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG .processor.DefaultErrorHandler - Using ExecutorService: org.apache.camel.util.concurrent.SizedScheduledExecutorService@20f78b0a[ErrorHandlerRedeliveryTask] for redeliveries on error handler: DefaultErrorHandler[InstrumentProcessorAdvice]
2019-02-13 14:39:36.843 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG .processor.DefaultErrorHandler - Using ExecutorService: org.apache.camel.util.concurrent.SizedScheduledExecutorService@20f78b0a[ErrorHandlerRedeliveryTask] for redeliveries on error handler: DefaultErrorHandler[InstrumentProcessorAdvice]
2019-02-13 14:39:36.843 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG .processor.DefaultErrorHandler - Using ExecutorService: org.apache.camel.util.concurrent.SizedScheduledExecutorService@20f78b0a[ErrorHandlerRedeliveryTask] for redeliveries on error handler: DefaultErrorHandler[InstrumentProcessorAdvice]
2019-02-13 14:39:36.849 [490f8c58da7accf9:] [pool-2-thread-1] INFO camel.impl.DefaultCamelContext - Route: main started and consuming from: direct://start
2019-02-13 14:39:36.850 [490f8c58da7accf9:] [pool-2-thread-1] INFO camel.impl.DefaultCamelContext - Route: http-call-route started and consuming from: direct://http-call-route
2019-02-13 14:39:36.850 [490f8c58da7accf9:] [pool-2-thread-1] INFO camel.impl.DefaultCamelContext - Total 2 routes, of which 2 are started
2019-02-13 14:39:36.850 [490f8c58da7accf9:] [pool-2-thread-1] INFO camel.impl.DefaultCamelContext - Apache Camel 2.23.1 (CamelContext: camel-2) started in 0.586 seconds
2019-02-13 14:39:36.859 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 1 save history time: 2
2019-02-13 14:39:36.894 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 35 save history time: 0
2019-02-13 14:39:36.955 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 60 save history time: 0
2019-02-13 14:39:37.017 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG amel.processor.FilterProcessor - Filter matches: false for exchange: Exchange[ff360297-c613-4653-a815-11a14b590f12]
2019-02-13 14:39:37.018 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 1 save history time: 0
2019-02-13 14:39:37.018 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 63 save history time: 0
2019-02-13 14:39:37.019 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG .camel.processor.SendProcessor - >>>> xslt://xslt/requestInvoicesReceived.xsl Exchange[ff360297-c613-4653-a815-11a14b590f12]
2019-02-13 14:39:37.201 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 183 save history time: 0
2019-02-13 14:39:37.202 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 1 save history time: 0
2019-02-13 14:39:37.202 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG .camel.processor.SendProcessor - >>>> direct://http-call-route Exchange[ff360297-c613-4653-a815-11a14b590f12]
2019-02-13 14:39:37.203 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 0 save history time: 0
2019-02-13 14:39:37.203 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 0 save history time: 0
2019-02-13 14:39:37.204 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG .camel.processor.SendProcessor - >>>> https://localhost?aliasHeader=certHeaderNameamp;connectTimeout=5000amp;socketTimeout=5000amp;connectionRequestTimeout=5000 Exchange[ff360297-c613-4653-a815-11a14b590f12]
2019-02-13 14:39:37.220 [490f8c58da7accf9:] [pool-2-thread-1] INFO curity.m2m.AccessTokenProvider - Fetching access token for scopes "ik ik-tsm-secret" from "https://url.com/identity/connect/token"
context.stopRoute: main - null
2019-02-13 14:39:55.855 [490f8c58da7accf9:] [ntExecutorGroup] INFO l.impl.DefaultShutdownStrategy - Starting to graceful shutdown 1 routes (timeout 1 milliseconds)
2019-02-13 14:39:55.858 [:] [ - ShutdownTask] INFO l.impl.DefaultShutdownStrategy - Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 0 seconds. Inflights per route: [main = 1]
2019-02-13 14:39:55.859 [490f8c58da7accf9:] [ntExecutorGroup] WARN l.impl.DefaultShutdownStrategy - Timeout occurred during graceful shutdown. Forcing the routes to be shutdown now. Notice: some resources may still be running as graceful shutdown did not complete successfully.
2019-02-13 14:39:55.861 [490f8c58da7accf9:] [ntExecutorGroup] INFO l.impl.DefaultShutdownStrategy - There are 1 inflight exchanges:
InflightExchange: [exchangeId=ff360297-c613-4653-a815-11a14b590f12, fromRouteId=main, routeId=http-call-route, nodeId=http-call, elapsed=0, duration=19007]
2019-02-13 14:39:55.861 [:] [ - ShutdownTask] INFO l.impl.DefaultShutdownStrategy - There are 1 inflight exchanges:
InflightExchange: [exchangeId=ff360297-c613-4653-a815-11a14b590f12, fromRouteId=main, routeId=http-call-route, nodeId=http-call, elapsed=0, duration=19007]
2019-02-13 14:39:55.861 [:] [ - ShutdownTask] WARN l.impl.DefaultShutdownStrategy - Interrupted while waiting during graceful shutdown, will force shutdown now.
2019-02-13 14:39:55.861 [:] [ - ShutdownTask] INFO l.impl.DefaultShutdownStrategy - Route: main shutdown complete, was consuming from: direct://start
2019-02-13 14:39:55.862 [490f8c58da7accf9:] [ntExecutorGroup] INFO l.impl.DefaultShutdownStrategy - Graceful shutdown of 1 routes completed in 0 seconds
2019-02-13 14:39:55.863 [490f8c58da7accf9:] [ntExecutorGroup] INFO camel.impl.DefaultCamelContext - Route: main is stopped, was consuming from: direct://start
context.stopRoute: http-call-route - null
2019-02-13 14:39:55.863 [490f8c58da7accf9:] [ntExecutorGroup] INFO l.impl.DefaultShutdownStrategy - Starting to graceful shutdown 1 routes (timeout 1 milliseconds)
2019-02-13 14:39:55.864 [:] [ - ShutdownTask] INFO l.impl.DefaultShutdownStrategy - Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 0 seconds. Inflights per route: [http-call-route = 1]
2019-02-13 14:39:55.865 [:] [ - ShutdownTask] WARN l.impl.DefaultShutdownStrategy - Interrupted while waiting during graceful shutdown, will force shutdown now.
2019-02-13 14:39:55.865 [490f8c58da7accf9:] [ntExecutorGroup] WARN l.impl.DefaultShutdownStrategy - Timeout occurred during graceful shutdown. Forcing the routes to be shutdown now. Notice: some resources may still be running as graceful shutdown did not complete successfully.
2019-02-13 14:39:55.865 [490f8c58da7accf9:] [ntExecutorGroup] INFO l.impl.DefaultShutdownStrategy - Graceful shutdown of 1 routes completed in 0 seconds
2019-02-13 14:39:55.865 [:] [ - ShutdownTask] INFO l.impl.DefaultShutdownStrategy - Route: http-call-route shutdown complete, was consuming from: direct://http-call-route
2019-02-13 14:39:55.866 [490f8c58da7accf9:] [ntExecutorGroup] INFO camel.impl.DefaultCamelContext - Route: http-call-route is stopped, was consuming from: direct://http-call-route
2019-02-13 14:39:55.866 [490f8c58da7accf9:] [ntExecutorGroup] INFO camel.impl.DefaultCamelContext - Apache Camel 2.23.1 (CamelContext: camel-2) is shutting down
2019-02-13 14:39:55.867 [490f8c58da7accf9:] [ntExecutorGroup] INFO l.impl.DefaultShutdownStrategy - Starting to graceful shutdown 2 routes (timeout 1 milliseconds)
2019-02-13 14:39:55.868 [:] [ - ShutdownTask] INFO l.impl.DefaultShutdownStrategy - Waiting as there are still 2 inflight and pending exchanges to complete, timeout in 0 seconds. Inflights per route: [http-call-route = 1, main = 1]
2019-02-13 14:39:55.868 [:] [ - ShutdownTask] INFO l.impl.DefaultShutdownStrategy - There are 1 inflight exchanges:
InflightExchange: [exchangeId=ff360297-c613-4653-a815-11a14b590f12, fromRouteId=main, routeId=http-call-route, nodeId=http-call, elapsed=0, duration=19014]
2019-02-13 14:39:55.869 [490f8c58da7accf9:] [ntExecutorGroup] WARN l.impl.DefaultShutdownStrategy - Timeout occurred during graceful shutdown. Forcing the routes to be shutdown now. Notice: some resources may still be running as graceful shutdown did not complete successfully.
2019-02-13 14:39:55.869 [:] [ - ShutdownTask] WARN l.impl.DefaultShutdownStrategy - Interrupted while waiting during graceful shutdown, will force shutdown now.
2019-02-13 14:39:55.869 [:] [ - ShutdownTask] INFO l.impl.DefaultShutdownStrategy - Route: http-call-route shutdown complete, was consuming from: direct://http-call-route
2019-02-13 14:39:55.869 [490f8c58da7accf9:] [ntExecutorGroup] INFO l.impl.DefaultShutdownStrategy - There are 1 inflight exchanges:
InflightExchange: [exchangeId=ff360297-c613-4653-a815-11a14b590f12, fromRouteId=main, routeId=http-call-route, nodeId=http-call, elapsed=0, duration=19015]
2019-02-13 14:39:55.869 [:] [ - ShutdownTask] INFO l.impl.DefaultShutdownStrategy - Route: main shutdown complete, was consuming from: direct://start
2019-02-13 14:39:55.869 [490f8c58da7accf9:] [ntExecutorGroup] INFO l.impl.DefaultShutdownStrategy - Graceful shutdown of 2 routes completed in 0 seconds
2019-02-13 14:39:55.876 [490f8c58da7accf9:] [ntExecutorGroup] WARN impl.DefaultInflightRepository - Shutting down while there are still 1 inflight exchanges.
2019-02-13 14:39:55.885 [490f8c58da7accf9:] [ntExecutorGroup] INFO camel.impl.DefaultCamelContext - Apache Camel 2.23.1 (CamelContext: camel-2) uptime 19.621 seconds
2019-02-13 14:39:55.886 [490f8c58da7accf9:] [ntExecutorGroup] INFO camel.impl.DefaultCamelContext - Apache Camel 2.23.1 (CamelContext: camel-2) is shutdown in 0.020 seconds
2019-02-13 14:39:55.889 [490f8c58da7accf9:] [ntExecutorGroup] ERROR ssors.IntegrationFlowProcessor - 590: IntegrationFlowExecutor timeout after 20000 milliseconds
com.s.sdd.abv.processors.ExecutorTimeoutException: IntegrationFlowExecutor timeout after 20000 milliseconds
at com.s.sdd.abv.processors.IntegrationFlowExecutor.process(IntegrationFlowExecutor.java:98)
at com.s.sdd.abv.processors.IntegrationFlowProcessor.processExchange(IntegrationFlowProcessor.java:88)
at com.s.sdd.abv.processors.IntegrationFlowProcessor.process(IntegrationFlowProcessor.java:71)
at org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
at org.apache.camel.component.netty4.handlers.ServerChannelHandler.processAsynchronously(ServerChannelHandler.java:141)
at org.apache.camel.component.netty4.handlers.ServerChannelHandler.channelRead0(ServerChannelHandler.java:112)
at org.apache.camel.component.netty4.http.handlers.HttpServerChannelHandler.channelRead0(HttpServerChannelHandler.java:195)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at org.apache.camel.component.netty4.http.handlers.HttpServerMultiplexChannelHandler.channelRead0(HttpServerMultiplexChannelHandler.java:143)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38)
at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:353)
at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.TimeoutException: null
at java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1771)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
at com.s.sdd.abv.processors.IntegrationFlowExecutor.process(IntegrationFlowExecutor.java:86)
... 20 common frames omitted
2019-02-13 14:40:22.321 [490f8c58da7accf9:] [pool-2-thread-1] INFO .http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {s}->https://www.aeat.es:443: Connection reset
2019-02-13 14:40:22.321 [490f8c58da7accf9:] [pool-2-thread-1] INFO .http.impl.execchain.RetryExec - Retrying request to {s}->https://www.aeat.es:443
2019-02-13 14:41:05.659 [490f8c58da7accf9:] [pool-2-thread-1] INFO .http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {s}->https://www.aeat.es:443: Connection reset
2019-02-13 14:41:05.659 [490f8c58da7accf9:] [pool-2-thread-1] INFO .http.impl.execchain.RetryExec - Retrying request to {s}->https://www.aeat.es:443
2019-02-13 14:41:49.021 [490f8c58da7accf9:] [pool-2-thread-1] INFO .http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {s}->https://www.aeat.es:443: Connection reset
2019-02-13 14:41:49.021 [490f8c58da7accf9:] [pool-2-thread-1] INFO .http.impl.execchain.RetryExec - Retrying request to {s}->https://www.aeat.es:443
2019-02-13 14:42:32.457 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 175.253 save history time: 0
2019-02-13 14:42:32.457 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG pache.camel.processor.Pipeline - Message exchange has failed: so breaking out of pipeline for exchange: Exchange[ff360297-c613-4653-a815-11a14b590f12] Exception: java.net.SocketException: Connection reset
2019-02-13 14:42:32.458 [490f8c58da7accf9:] [pool-2-thread-1] INFO ceptors.FlowHistoryInterceptor - Processing time: 175.255 save history time: 1
2019-02-13 14:42:32.458 [490f8c58da7accf9:] [pool-2-thread-1] DEBUG pache.camel.processor.Pipeline - Message exchange has failed: so breaking out of pipeline for exchange: Exchange[ff360297-c613-4653-a815-11a14b590f12] Exception: java.net.SocketException: Connection reset
Комментарии:
1. Есть ли у вас требование сохранять время ожидания завершения работы равным 1 миллису?
2. @Srini мы хотим завершить работу / прервать контекст как можно быстрее
3. Какую версию Camel вы используете?
4. @Srini Я верблюд 2.23.1
5. 1 миллиметр — это слишком мало, чтобы иметь смысл быть корректным завершением работы. Также, почему бы не просто
context.stop();
? Вам не нужно вручную останавливать все маршруты раньше. из документа:will stop all routes/components/endpoints etc and clear internal state/cache