我是 ActiveMQ Artemis 的新手
我已阅读文档,发现客户端使用连接器来定义它如何连接到服务器。
我有一个 Broker.xml 文件,其中包含以下代码
<connectors>
<connector name="netty-connector">tcp://0.0.0.0:61616</connector>
<!-- connector to the server1 -->
<connector name="server1-connector">tcp://0.0.0.0:9616</connector>
</connectors>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://0.0.0.0:61616</acceptor>
</acceptors>
所以接受者在这里说,嘿,你可以在端口 61617 上与我连接,我正在监听它(这对我来说是有意义的) 但是连接器在这个broker.xml中的作用又如何呢? 连接器的目标端口与接受器中的端口(tcp://0.0.0.0:61616)相同, 我想了解Connector中提到的端口是什么意思,请解释一下。
最佳答案
您是否碰巧读过 the documentation关于这个话题?有一个标题为“了解连接器”的部分应该可以回答您的大多数(如果不是全部)问题。我将引用最重要的部分:
Whereas acceptors are used on the server to define how we accept connections, connectors are used to define how to connect to a server.
A
connector
is used when the server acts as a client itself, e.g.:
- When one server is bridged to another
- When a server takes part in a cluster
In these cases the server needs to know how to connect to other servers. That's defined by
connectors
.
关于activemq-artemis - 了解连接器 ActiveMQ Artemis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47516209/