You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The channel.addShutdownListener(this); and rabbitConnection.addShutdownListener(this); are two different entities.
We just cannot compare them or replace one with another if I understood your request correctly.
I'm also not sure in your connection.getDelegate() since it feels like something else is missed in your logic.
I agree that there is no easy way to implement your requirement with out-of-the-box AbstractConnectionFactory implementations.
I'll go ahead and add the mentioned rabbitConnection.addShutdownListener(this); into the AbstractConnectionFactory#L580.
Looks like AbstractConnectionFactory.shutdownCompleted() is aware of connection shutdowns as well.
Thus we can receive an AMQConnection shutdown signal.
For CachingConnectionFactory, it does do this thing for AMQChannel creation at line 712:
spring-amqp/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/CachingConnectionFactory.java
Lines 698 to 714 in ccca9d9
We can do this within below codes maybe?
For example, add
rabbitConnection.addShutdownListener(this);
under line 584.spring-amqp/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/AbstractConnectionFactory.java
Lines 580 to 626 in ccca9d9
Currently, I do this at ConnectionListener's onCreate method instead which is not straightforward.
The text was updated successfully, but these errors were encountered: