camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fergus Nelson (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-7042) Graceful shutdown of RabbitMQConsumer requires channel.close()
Date Thu, 05 Dec 2013 13:56:35 GMT
Fergus Nelson created CAMEL-7042:
------------------------------------

             Summary: Graceful shutdown of RabbitMQConsumer requires channel.close()
                 Key: CAMEL-7042
                 URL: https://issues.apache.org/jira/browse/CAMEL-7042
             Project: Camel
          Issue Type: Bug
          Components: camel-rabbitmq
            Reporter: Fergus Nelson
            Priority: Minor


doStop on the RabbitMQConsumer does not close the channel correctly. This doesn't cause any
problems on Jetty, but on Tomcat7 it prevented my app from shutting down gracefully. I suggest
the doStop method on the consumer should match that of the producer

 protected void doStop() throws Exception {
        super.doStop();
        log.info("Stopping RabbitMQ consumer");
        if (channel != null) {
            log.debug("Closing channel: {}", channel);
            channel.close();
        }
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception ignored) {
                // ignored
            }
        }

        channel = null;
        conn = null;

        if (executor != null) {
            if (getEndpoint() != null && getEndpoint().getCamelContext() != null)
{
                getEndpoint().getCamelContext().getExecutorServiceManager().shutdownNow(executor);
            } else {
                executor.shutdownNow();
            }
        }
        executor = null;
    }



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message