惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tor Project blog
Cloudbric
Cloudbric
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
N
News | PayPal Newsroom
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Privacy & Cybersecurity Law Blog
Simon Willison's Weblog
Simon Willison's Weblog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 三生石上(FineUI控件)
E
Exploit-DB.com RSS Feed
WordPress大学
WordPress大学
F
Fortinet All Blogs
O
OpenAI News
IT之家
IT之家
Vercel News
Vercel News
G
Google Developers Blog
Spread Privacy
Spread Privacy
T
The Blog of Author Tim Ferriss
T
The Exploit Database - CXSecurity.com
V
V2EX - 技术
I
Intezer
N
News and Events Feed by Topic
W
WeLiveSecurity
宝玉的分享
宝玉的分享
AWS News Blog
AWS News Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
I
InfoQ
The GitHub Blog
The GitHub Blog
C
Check Point Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
LangChain Blog
月光博客
月光博客
Microsoft Security Blog
Microsoft Security Blog
C
CERT Recently Published Vulnerability Notes
Hugging Face - Blog
Hugging Face - Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Comments on: Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Recent Announcements
Recent Announcements
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
Cyberwarzone
Cyberwarzone
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - PanPan003

decimal, double在 c#中的区别 python environment settings xUnit Theory: Working With InlineData, MemberData, ClassData docker network - container networking KEDA — Kubernetes Based Event Driven Auto scaling(转载) rabbit MQ —— ha-sync-mode. message 同步/ 丢失 in new pods rabbit MQ —— ha-mode, message 同步策列:所有nodes or one nodes 博文阅读密码验证 - 博客园 Kubernetes hpa container scale up/ down 原理 in kubernetes 博文阅读密码验证 - 博客园 Windows证书管理器 && SSL certification && WSL-Docker: curl: (60) SSL certificate problem: unable to get local issuer certificate 博文阅读密码验证 - 博客园 httpclient in .net _ 压缩 MongoDB 大文件处理 _ Building MongoDB Applications with Binary Files Using GridFS 博文阅读密码验证 - 博客园 Mock —— .Protected() .Setup XUnit —— Record.Exception —— Stop Using Assert.Throws in Your BDD Unit Tests What is .NET MAUI? —— a cross-platform framework for creating native mobile and desktop apps with C# and XAML.
RabbitMQ _ How to Close a Channel
PanPan003 · 2023-04-28 · via 博客园 - PanPan003

https://low-orbit.net/rabbitmq-how-to-close-a-channel

RabbitMQ How to Close a Channel

If you have found your way to this page you are probably wondering how to close a channel in RabbitMQ. Channels should be closed when they are no longer in use. There are multiple different ways of going about doing this that we are going to cover.

To close a RabbitMQ channel do one of the following:

  • Kill the corresponding consumer.
  • Close the channel from within your code: channel.close()
  • Close the associated connection from within your code: connection.close()
  • Use the CLI command: rabbitmqctl close_connection CONNECTION-NAME “my message”
  • Click on the button in the web GUI to close it.

Programmatically Close a RabbitMQ Channel

Option 1: Close Channel

A channel can be programmatically closed like this:

channel.close()

Option 2: Close Connection

All channels on a connection will be closed when you close that connection. You can close a connection programmatically like this:

connection.close()

Using the CLI

You can close a channel from the CLI by closing it’s connection.

To close a channel using the CLI you will first need to find the channel and it’s associated connection. Use the following command to list out channels and connections.

rabbitmqctl list_channels connection

You can close the channel’s connection using the following command. You need to specify the connection which we found previously. The last parameter is a message explaining why the connection is being closed. This will be included in the error message that is output by the consumer.

rabbitmqctl close_connection "<rabbit@zippy-zap.1608598465.5412.0
>" "go away"