RabbitMQ 创建连接是一个昂贵的操作 [英] RabbitMQ create connection is an expensive operation

查看:35
本文介绍了RabbitMQ 创建连接是一个昂贵的操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 RabbtiMQ .net 客户端中创建连接是一项昂贵的操作吗?

is creating a connection in RabbtiMQ .net client an expensive operation?

我们有一个向 RMQ 发布消息的 Web 应用程序,目前我们在每次发布时创建并关闭连接.

We have a Web application that publishes message to the RMQ, and currently we create and close the connection on every publish.

推荐答案

是的,创建连接的成本很高.发布后为什么还要创建和关闭与rabbit 的连接?

Yes, creating connection is expensive. Why are you creating and closing connection to rabbit anyway after publish?

我建议创建一次兔子连接,然后在需要时关闭它.

I would suggest create rabbit connection once, then close it whenever you need to.

这篇关于RabbitMQ 创建连接是一个昂贵的操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆