RabbitMQ:更改服务器的默认端口

RabbitMQ: Change the default port of the server

您好,我是 rabbitMQ 的新手,我在 Windows 上使用 c#,我需要更改端口以与服务器通信。我在 rabbitMQ 文档中搜索了很多,但可能会很困惑。谁能教我更改端口的步骤?最初我试过像这样更改客户端程序连接配置中的端口:

var factory = new ConnectionFactory();
//connection hostname etc...
factory.Port =8080;

但我想这还不够吧?有人可以教我怎么做吗??

为了在不同的端口上与服务器通信,您需要首先告诉 RabbitMQ 它应该监听哪个端口。

最简单的方法是通过环境变量自定义:

If you need to customise names, ports, locations, it is easiest to configure environment variables in the Windows dialogue: Start > Settings > Control Panel > System > Advanced > Environment Variables.

Create or edit the system variable name and value. For environment changes to take effect on Windows, the service must be re-installed. It is not sufficient to restart the service.

更多信息请查看官方文档:http://www.rabbitmq.com/configure.html#customise-general-unix-environment