简体   繁体   English

客户端机器上使用什么端口向 rabbitmq 发送消息?

[英]What port is used on the client machine to send messages to rabbitmq?

I have created a small class for demonstration purpose that sends a message to rabbitmq on a specific port:我创建了一个小型 class 用于演示目的,它在特定端口上向 rabbitmq 发送消息:

class RabbitMqPublisher
{
    private IAdvancedBus _advancedBus;
    public RabbitMqPublisher()
    {
        _advancedBus = RabbitHutch.CreateBus("host=rabbitmq-server:5672;virtualHost=/;username=user;password=pass").Advanced;
    }

    public void PublishMessage(string message)
    {
        var routingKey = "SimpleMessage";

        // declare some objects
        var queue = _advancedBus.QueueDeclare("TestQueue.SimpleMessage");
        var exchange = _advancedBus.ExchangeDeclare("TestExchange.SimpleMessage", ExchangeType.Direct);
        var binding = _advancedBus.Bind(exchange, queue, routingKey);

        _advancedBus.Publish(exchange, routingKey, true, new Message<string>(message));
    }
}

In this case the port on which the RabbitMQ server is waiting for messages is 5672 .在这种情况下,RabbitMQ 服务器等待消息的端口是5672 My question is besides that, what port is used by the client to send this message , and would it be possible to configure it?除此之外,我的问题是,客户端使用什么端口发送此消息,是否可以配置它?

15672 FROM HTTP API CLIENT 15672来自 HTTP API 客户端

Port Access端口访问

Firewalls and other security tools may prevent RabbitMQ from binding to a port.防火墙和其他安全工具可能会阻止 RabbitMQ 绑定到端口。 When that happens, RabbitMQ will fail to start.发生这种情况时,RabbitMQ 将无法启动。 Make sure the following ports can be opened:确保可以打开以下端口:

4369: epmd, a peer discovery service used by RabbitMQ nodes and CLI tools 4369:epmd,RabbitMQ 节点和 CLI 工具使用的对等发现服务

5672, 5671: used by AMQP 0-9-1 and 1.0 clients without and with TLS 5672、5671:由不带和带 TLS 的 AMQP 0-9-1 和 1.0 客户端使用

25672: used by Erlang distribution for inter-node and CLI tools communication and is allocated from a dynamic range (limited to a single port by default, computed as AMQP port + 20000). 25672:被 Erlang 分发用于节点间和 CLI 工具通信,并从动态范围分配(默认限制为单个端口,计算为 AMQP 端口 + 20000)。 See networking guide for details.有关详细信息,请参阅网络指南。

15672 : HTTP API clients and rabbitmqadmin (only if the management plugin is enabled) 15672 : HTTP API 客户端和rabbitmqadmin(仅在启用管理插件的情况下)

61613, 61614: STOMP clients without and with TLS (only if the STOMP plugin is enabled) 61613、61614:不带和带 TLS 的 STOMP 客户端(仅在启用 STOMP 插件的情况下)

1883, 8883: (MQTT clients without and with TLS, if the MQTT plugin is enabled 1883、8883:(如果启用了 MQTT 插件,则不带和带 TLS 的 MQTT 客户端

15674: STOMP-over-WebSockets clients (only if the Web STOMP plugin is enabled) 15674:STOMP-over-WebSockets 客户端(仅当 Web STOMP 插件启用时)

15675: MQTT-over-WebSockets clients (only if the Web MQTT plugin is enabled) 15675:MQTT-over-WebSockets 客户端(仅当启用 Web MQTT 插件时)

Reference doc: https://www.rabbitmq.com/install-windows-manual.html参考文档: https://www.rabbitmq.com/install-windows-manual.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM