Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.15.2
-
None
-
Unknown
Description
I'm using this URI: netty4:tcp://localhost:8888?sync=false&textline=true
And I have this issue when initiating Camel shutdown using DefaultShutdownStrategy:
- Camel suspends NettyConsumer (SingleTCPNettyServerBootstrapFactory), which only stops the "main" Netty channel, but not the other Netty channels (i.e. socket connections)
- Camel waits for routes to be empty of inflight & pending exchanges
- Those other Netty channels kept receiving data, which are turned into new exchanges
- As long as the TCP clients keep sending data into the channels + exchanges completing slower than send rate, routes will never be empty of inflight & pending exchanges
- Forced shutdown after 5 minutes (timed out)
To simulate the issue
- Run the attached tcp-server.camel Groovy script: groovy tcp-server.camel
- After that has started, run the attached tcp-client.groovy: groovy tcp-client.groovy
- After tcp-client starts sending data over, stop the tcp-server (CTRL+C in Windows)
- You should see something like this:
cmd
INFO - Apache Camel 2.15.2 (CamelContext: camel-1) started in 1.015 seconds
INFO - Hey 0
INFO - Hey 1
INFO - Hey 2
INFO - Hey 3
INFO - Apache Camel 2.15.2 (CamelContext: camel-1) is shutting down
INFO - Starting to graceful shutdown 1 routes (timeout 300 seconds)
INFO - Waiting as there are still 1 inflight and pending exchanges to complete,
timeout in 300 seconds.
INFO - Hey 4
INFO - Waiting as there are still 1 inflight and pending exchanges to complete,
timeout in 299 seconds.
INFO - Waiting as there are still 1 inflight and pending exchanges to complete,
timeout in 298 seconds.
INFO - Hey 5
INFO - Waiting as there are still 1 inflight and pending exchanges to complete,
timeout in 297 seconds.
INFO - Waiting as there are still 1 inflight and pending exchanges to complete,
timeout in 296 seconds.
INFO - Hey 6
INFO - Waiting as there are still 1 inflight and pending exchanges to complete,
timeout in 295 seconds.
INFO - Waiting as there are still 1 inflight and pending exchanges to complete,
timeout in 294 seconds.
...