Skip to content

Commit

Permalink
Merge pull request #8 from MO-RISE/properties_handling
Browse files Browse the repository at this point in the history
Making sure to handle MQTTv5 properties correctly
  • Loading branch information
freol35241 authored May 9, 2022
2 parents 8367448 + fb09667 commit 18e2233
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,19 @@
# on-message callbacks
def publish_to_source(client, userdata, message): # pylint: disable=unused-argument
"""Publish to source broker"""
source.publish(message.topic, message.payload, message.qos, message.retain)
source.publish(
message.topic, message.payload, message.qos, message.retain, message.properties
)


remote.on_message = publish_to_source


def publish_to_remote(client, userdata, message): # pylint: disable=unused-argument
"""Publish to remote broker"""
remote.publish(message.topic, message.payload, message.qos, message.retain)
remote.publish(
message.topic, message.payload, message.qos, message.retain, message.properties
)


source.on_message = publish_to_remote
Expand Down

0 comments on commit 18e2233

Please sign in to comment.