如果Rabbitmq节点是Down并且我们启动Rabbitmq Listener Container,那么它将循环 infinite Times 直到它连接到Rabbitmq Node.So如果它没有连接到Rabbitmq节点,我们如何能够阻止Listener Container的无限尝试?
你需要的是 Listener Container failedEvent,它被发射为;
Listener Container
private void logException(Throwable t) { if (logger.isDebugEnabled() || !(t instanceof AmqpConnectException || t instanceof CancelledException)) { logger.warn( " raised exception, processing can restart if the connection factory supports it", t); } else { logger.warn(" raised exception, processing can restart if the connection factory supports it. " + "Exception summary: " + t); } publishFailedEvent(" raised exception, attempting restart", false, t); }
因此,您可以监听这些事件并在达到某些条件时停止您的应用程序 .
1 回答
你需要的是
Listener Container
failedEvent,它被发射为;因此,您可以监听这些事件并在达到某些条件时停止您的应用程序 .