【问题标题】:unable to connect php stomp to remote activemq无法将php stomp连接到远程activemq
【发布时间】:2023-08-04 18:10:01
【问题描述】:

代码

try {
    $stomp = new Stomp('tcp://xx:xxx:xxx:xxx:61616','admin','admin'); 
    // connection to remote server
} catch(StompException $e) {
    die('Connection failed: ' . $e->getMessage());
}

结果

Connection failed: Server is not responding

以上代码适用于localhost 或Intranet,但不适用于外部IP,

使用 java 代码连接到同一服务器,但不能使用 php stomp

【问题讨论】:

  • 您必须联系具有外部 IP 的服务器的管理员。
  • 但是通过使用 java 代码我可以连接到同一台服务器

标签: php activemq stomp


【解决方案1】:

通常端口 61616 是代理的 OpenWire 端口,因此 STOMP 客户端将无法连接到它。如果您已将其配置为 STOMP 并且仍然无法从本地网络外部访问它,则可能是防火墙问题或其他一些网络策略阻止了客户端通过的能力。由于我们不知道您的配置或网络拓扑,因此您的管理部门之外的任何人都无能为力。

【讨论】: