简体   繁体   中英

Handling Custom exception for rabbitmq listener connectivity issues

I have a listener which consumes the messages from the third party producer.I need to send the custom error message in case of the queue connection issues

I'm new to rabbit mq.May I know what are the ways to handle the custom exception here

You can use a ConnectionListener callback and inject it into a org.springframework.amqp.rabbit.connection.ConnectionFactory configuration:

void addConnectionListener(ConnectionListener listener);

https://docs.spring.io/spring-amqp/docs/current/reference/html/#connection-channel-listeners

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