i want to communicate with an ActiveMQ Broker using stomp.py . I can hear what is happening on different topics, but i dont get an answer on my requests. this is my code (from the docs) (no auth required)
import os
import time
import stomp
def connect_and_subscribe(conn):
conn.connect(wait=True)
conn.subscribe(destination='/queue/test', id=1, ack='auto')
class MyListener(stomp.ConnectionListener):
def __init__(self, conn):
self.conn = conn
def on_error(self, frame):
print('received an error "%s"' % frame.body)
def on_message(self, frame):
print('received a message "%s"' % frame.body)
for x in range(10):
print(x)
time.sleep(1)
print('processed message')
def on_disconnected(self):
print('disconnected')
connect_and_subscribe(self.conn)
conn = stomp.Connection([(URL, 62613)])
conn.set_listener('', MyListener(conn))
connect_and_subscribe(conn)
time.sleep(60)
conn.disconnect()
i know my broker requires SSL. From what i read here:
https://github.com/jasonrbriggs/stomp.py/issues/257
For SSL, a conn.start() would be necessary. I dont understand whether conn.start() is deprecated/ not necessary anymore or not. If i put in an conn.start(), i get:
AttributeError: ‘StompConnection11’ object has no attribute ‘start’
just like other people did:
https://github.com/Yelp/elastalert/issues/2731
Is a conn.start() still needed and do i update my python version? Any other suggestions?