Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14368

can't gracefully shutdown a camel-undertow consumer endpoint

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.25.0, 3.1.0
    • None
    • None
    • Unknown

    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.

      Attachments

        Activity

          People

            ffang Freeman Yue Fang
            ffang Freeman Yue Fang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: