无法使用 STOMP 将消息发送到 activemq

unable to send message using STOMP to activemq

我正在尝试使用 STOMP 协议向我的 activemq 发送消息,但出现以下错误:

(limetray) Vaibhavs-MacBook-Air:Desktop vaibhav$ python receiver_topic.py heyhey
Unknown response frame type: ';activemq' (frame length was 11)
Unknown response frame type: '
                              ' (frame length was 2)
Unknown response frame type: ')' (frame length was 2)
Unknown response frame type: '
                              ' (frame length was 1)
Unknown response frame type: 'tcpnodelayenabled' (frame length was 20)
Unknown response frame type: 'sizeprefixdisabled' (frame length was 20)
Unknown response frame type: '  cachesize' (frame length was 11)
Unknown response frame type: '' (frame length was 1)
Unknown response frame type: '

我正在使用下面的 python 脚本发送消息:

class MyListener(stomp.ConnectionListener):
    def on_error(self, headers, message):
        print('received an error "%s"' % message)
    def on_message(self, headers, message):
        print('received a message "%s"' % message)
hosts = [('localhost', 61616)]

conn = stomp.Connection(host_and_ports=hosts)
conn.set_listener('', MyListener())
conn.start()
conn.connect('admin', 'admin', wait=True,headers = {'client-id': 'clientname'} )
conn.subscribe(destination='A.B.C.D', id=1, ack='auto',headers = {'subscription-type': 'MULTICAST','durable-subscription-name':'someValue'})
#conn.subscribe({destination=config['/topic/test'], ack:'auto', 'activemq.subscriptionName':'SampleSubscription'})
#conn.subscribe(destination='/topic/testTopic', ack='auto', headers = {'activemq.subscriptionName': 'myhostname'})

conn.send(body=' '.join(sys.argv[1:]), destination='A.B.C.D')

time.sleep(2)
conn.disconnect()

用于调用脚本的命令:

python receiver_topic.py heyhey

我认为 activemq.xml 文件中需要添加一些内容。对此的任何建议都会非常有帮助。

从提供的内容来看,您似乎正在连接到默认为“61616”的代理上的 Openwire 端口,而 STOMP 端口通常为“61613”,因此我的建议是检查 STOMP 连接器的端口绑定到并确保您连接到那个。