Description
For example if we have a camel-undertow consumer endpoint like
<route id="counter-route"> <from uri="undertow:http://0.0.0.0:8080/srv/count"/> <process ref="counterProcessor"/> </route>
and the the counterProcessor is like
public class CounterProcessor implements Processor { private static final transient Logger LOG = LoggerFactory.getLogger(CounterProcessor.class); public void process(Exchange exchange) throws Exception { Long count = 0L; if (exchange.getIn().getHeader("count", Long.class) != null) { count = exchange.getIn().getHeader("count", Long.class); } String cid = exchange.getIn().getHeader("cid", String.class); Long delay = 0L; if (exchange.getIn().getHeader("delay", Long.class) != null) { delay = exchange.getIn().getHeader("delay", Long.class); } Long c = count + 1; LOG.info("count before delay {} {}", cid, c); Thread.sleep(delay == null ? 0 : delay); LOG.info("count after delay {} {}", cid, c); exchange.getOut().setBody(UuidBean.uuid() + " " + c); } }
If we send http request with url like
http://localhost:8080/srv/count?count=5&cid=42&delay=20000
This suppose to return in 20 sec. If we use "kill -15 process_id_camel_route", we should wait and see this camel route gracefully shutdown and let the flight exchange finish. But it's not this case now, while with camel-jetty, it works as expected.