Skip to content
Snippets Groups Projects
Commit 9b512ef8 authored by Sven-Ove Hänsel's avatar Sven-Ove Hänsel
Browse files

add keepalive and quality of service

parent 84b228cf
No related branches found
No related tags found
No related merge requests found
......@@ -214,7 +214,7 @@ def on_connect(client, userdata, flags, return_code):
'''
if return_code == 0:
print("connected")
client.subscribe("neo4j")
client.subscribe("neo4j",qos=1)
else:
print("could not connect, return code:", return_code)
client.failed_connect = True
......@@ -263,7 +263,7 @@ client.on_connect = on_connect
client.on_message = on_message
client.failed_connect = False
client.connect(broker_hostname, port)
client.connect(broker_hostname, port,keepalive=3600*4)
client.loop_start()
# this try-finally block ensures that whenever we terminate the program earlier by hitting ctrl+c, it still gracefully exits
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment