简体   繁体   English

用于ActiveMQ + WebSockets的PHP Stomp客户端库

[英]PHP Stomp client library for ActiveMQ + WebSockets

I've installed ActiveMQ with WebSocket support and I'm able to get the JS demo working. 我已经安装了支持WebSocket的ActiveMQ,我可以让JS演示工作。 The issue that I'm facing right now is that the PHP Stomp library won't work with the WebSocket URI so when I try: 我现在面临的问题是PHP Stomp库不能与WebSocket URI一起使用,所以当我尝试:

$stomp = new Stomp('ws://localhost:61614');

I get: 我明白了:

Connection failed: Invalid Broker URI scheme 连接失败:无效的代理URI方案

Any thoughts on how I can send messages via PHP? 关于如何通过PHP发送消息的任何想法? Am I looking at this from the wrong angle. 我是从错误的角度看这个吗? Should I try regular PHP socket functions to connect to ActiveMQ ? 我应该尝试常规的PHP套接字函数来连接到ActiveMQ吗?

Thanks. 谢谢。

Yes, from PHP you should connect to the message queue over TCP. 是的,从PHP开始,您应该通过TCP连接到消息队列。 Internally this will be using PHP's sockets or stream sockets, but you should be able to simply use the STOMP library normally. 在内部,这将使用PHP的套接字或流套接字,但您应该能够正常使用STOMP库。

Par exemple: 例如:

$stomp = new Stomp('tcp://localhost:61613');

You'll need to make sure that regular STOMP is enabled in ActiveMQ. 您需要确保在ActiveMQ中启用常规STOMP。

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

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