【问题标题】:not able to connect to ActiveMQ outside network无法连接到外部网络的 ActiveMQ
【发布时间】:2014-08-17 22:56:20
【问题描述】:

我已经在我的VPS ( virtual private server) 上安装了Apache ActiveMQ,现在问题是当我尝试使用以下 TCP url 在 android 中建立连接时

"tcp://134.12.333.44@61616" // 无法连接

"tcp://134.12.333.44@1883" // 无法连接

但我无法连接它并在 android 中出现以下异常

 MqttException: MQIsdp ClientId > 23 bytes

这是我的activemq.xml的内容

 <transportConnectors>
            <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        </transportConnectors>

当我在网络外访问 ActiveMQ 时,我的服务器对上面的配置进行了更改 即134.12.333.44(它是一个假ip,只是为了展示一个例子)

    <transportConnector name="openwire" uri="tcp://134.12.333.44:61616?

maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>



     <transportConnector name="mqtt" uri="mqtt://134.12.333.44:1883?

maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>

【问题讨论】:

    标签: android tcp activemq


    【解决方案1】:

    如果您的 android 客户端是 MQTT,那么尝试连接到端口 61616 肯定是行不通的,因为那是您配置的 OpenWire 传输连接器,所以不要这样做。至于到 1883 的连接,您可能需要在防火墙上打开该端口,因为我在您的问题中没有看到任何对该步骤的引用。

    仅仅因为您在 ActiveMQ 上配置了这些端口并不能让外部世界访问它们。您需要配置或让您的网络管理员配置您的防火墙以允许该端口上的流量。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-01
      • 1970-01-01
      • 2021-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多