Merge pull request #528 from mparada/update-stomp-py-example

conn.start deprecated, id argument necessary by conn.subscribe
This commit is contained in:
Jean-Baptiste Onofré 2020-05-09 07:35:27 +02:00 committed by GitHub
commit 0bdaf88780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -56,9 +56,8 @@ class MyListener(object):
conn = stomp.Connection(host_and_ports = [(host, port)])
conn.set_listener('', MyListener(conn))
conn.start()
conn.connect(login=user,passcode=password)
conn.subscribe(destination=destination, ack='auto')
conn.subscribe(destination=destination, id=1, ack='auto')
print("Waiting for messages...")
while 1:
time.sleep(10)