Я пытаюсь использовать протокол 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. Любые предложения по этому вопросу будут очень полезны.