简体   繁体   中英

How to disconnect a Channel manually from listener in spring-rabbitmq + spring cloud

I have created a RabbitMQ application using Spring Cloud + Spring Boot and based on the following logic: I am closing the channel which will stop the assigned listener from accepting requests.

When I close the channel using channel.close() method, I am able to see the channel getting auto-created and calling the listener again.

Is there any way to disable the auto-creation of channels?

It sounds like you are using a listener container; you must not close() its channel(s).

You need to stop() the container instead (which will close the channel).

Exactly how to do that depends on how you are using the framework - edit the question to show the configuration and your listener.

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