@Override public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) { if (logger.isDebugEnabled()) { if (RabbitUtils.isNormalShutdown(sig)) { logger.debug("Received shutdown signal for consumer tag=" + consumerTag + ": " + sig.getMessage()); } else { logger.debug("Received shutdown signal for consumer tag=" + consumerTag, sig); } } BlockingQueueConsumer.this.shutdown = sig; // The delivery tags will be invalid if the channel shuts down BlockingQueueConsumer.this.deliveryTags.clear(); BlockingQueueConsumer.this.activeObjectCounter.release(BlockingQueueConsumer.this); }
@Override public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) { if (logger.isDebugEnabled()) { if (RabbitUtils.isNormalShutdown(sig)) { logger.debug("Received shutdown signal for consumer tag=" + consumerTag + ": " + sig.getMessage()); } else { logger.debug("Received shutdown signal for consumer tag=" + consumerTag, sig); } } BlockingQueueConsumer.this.shutdown = sig; // The delivery tags will be invalid if the channel shuts down BlockingQueueConsumer.this.deliveryTags.clear(); BlockingQueueConsumer.this.activeObjectCounter.release(BlockingQueueConsumer.this); }
/** * Close the given RabbitMQ Channel and ignore any thrown exception. This is useful for typical <code>finally</code> * blocks in manual RabbitMQ code. * @param channel the RabbitMQ Channel to close (may be <code>null</code>) */ public static void closeChannel(@Nullable Channel channel) { if (channel != null) { try { channel.close(); } catch (AlreadyClosedException ace) { // empty } catch (IOException ex) { logger.debug("Could not close RabbitMQ Channel", ex); } catch (ShutdownSignalException sig) { if (!isNormalShutdown(sig)) { logger.debug("Unexpected exception on closing RabbitMQ Channel", sig); } } catch (Exception ex) { logger.debug("Unexpected exception on closing RabbitMQ Channel", ex); } } }
/** * Close the given RabbitMQ Channel and ignore any thrown exception. This is useful for typical <code>finally</code> * blocks in manual RabbitMQ code. * @param channel the RabbitMQ Channel to close (may be <code>null</code>) */ public static void closeChannel(@Nullable Channel channel) { if (channel != null) { try { channel.close(); } catch (AlreadyClosedException ace) { // empty } catch (IOException ex) { logger.debug("Could not close RabbitMQ Channel", ex); } catch (ShutdownSignalException sig) { if (!isNormalShutdown(sig)) { logger.debug("Unexpected exception on closing RabbitMQ Channel", sig); } } catch (Exception ex) { logger.debug("Unexpected exception on closing RabbitMQ Channel", ex); } } }
/** * Return true if the {@link ShutdownSignalException} reason is AMQP.Channel.Close and * the reply code was AMQP.REPLY_SUCCESS (200) and the text equals "OK". * @param sig the exception. * @return true for a normal channel close. */ public static boolean isNormalChannelClose(ShutdownSignalException sig) { Method shutdownReason = sig.getReason(); return isNormalShutdown(sig) || (shutdownReason instanceof AMQP.Channel.Close && AMQP.REPLY_SUCCESS == ((AMQP.Channel.Close) shutdownReason).getReplyCode() && "OK".equals(((AMQP.Channel.Close) shutdownReason).getReplyText())); }
/** * Return true if the {@link ShutdownSignalException} reason is AMQP.Channel.Close and * the reply code was AMQP.REPLY_SUCCESS (200) and the text equals "OK". * @param sig the exception. * @return true for a normal channel close. */ public static boolean isNormalChannelClose(ShutdownSignalException sig) { Method shutdownReason = sig.getReason(); return isNormalShutdown(sig) || (shutdownReason instanceof AMQP.Channel.Close && AMQP.REPLY_SUCCESS == ((AMQP.Channel.Close) shutdownReason).getReplyCode() && "OK".equals(((AMQP.Channel.Close) shutdownReason).getReplyText())); }
if (!RabbitUtils.isNormalShutdown(e6)) { logger.debug("Unexpected exception on deferred close", e6);
if (!RabbitUtils.isNormalShutdown(e6)) { logger.debug("Unexpected exception on deferred close", e6);
if (RabbitUtils.isNormalShutdown(e)) { if (logger.isDebugEnabled()) { logger.debug("Consumer received Shutdown Signal, processing stopped: " + e.getMessage());
if (RabbitUtils.isNormalShutdown(e)) { if (logger.isDebugEnabled()) { logger.debug("Consumer received Shutdown Signal, processing stopped: " + e.getMessage());