简体   繁体   中英

How to handle when the BROKER rabbitMq is down in Spring cloud stream?

我想了解我们该如何处理经纪人本身处于关闭状态的情况,这是RabbitMQ,我也不想尝试RETRY机制。相反,我想检查一下Spring Cloud流, 怎么回事?检测RabbitMQ是否关闭 ,根据这种情况,我需要推送消息。

@AutoWired
private CachingConnectionFactory connectionFactory;

Call connectionFactory.createConnection().close() to verify that the broker is up. If it's not you'll catch an exception.

In general, this won't open a new connection, it will just check that the shared (or a cached) connection is available.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM