与ActiveMQ的Python Stomp连接具有错误的主题名称

问题描述 投票:0回答:1

我正在尝试为ActiveMQ服务器形成Python + Stomp订阅。我正在测试localhost上的ActiveMQ服务器。这一切似乎都运行正常,除了主题XYZ的订阅名称被命名为ActiveMQ.Advisory.Consumer.Queue.XYZ,我想要连接的队列(由java客户端创建)仅命名为XYZ

有没有办法订阅这个“短”名称队列?

import stomp

QUEUE_NAME='XYZ'

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)

headers = {}
conn = stomp.Connection( )
conn.set_listener('127.0.0.1:61616', MyListener())
conn.start()
conn.connect('admin', 'admin', wait=True)

conn.subscribe(destination=QUEUE_NAME, id=2, ack='auto')

time.sleep(6660)
conn.disconnect()

本地ActiveMQ控制台显示“主题”:Screenshot of ActiveMQ Topics panel

而真正的服务器有一个短命名的队列:Correct Name

python activemq stomp
1个回答
2
投票

这似乎是正常的经纪人行为,以支持“咨询消息”。它不应该对您的应用程序产生任何直接影响。有关详细信息,请参阅ActiveMQ documentation on this subject

© www.soinside.com 2019 - 2024. All rights reserved.