Skip to content

Commit

Permalink
Merge pull request #6 from SSU-NC/dev
Browse files Browse the repository at this point in the history
Merge dev as master for release.
  • Loading branch information
KumKeeHyun authored Nov 17, 2020
2 parents f3d867f + e03a3d3 commit 93bbf5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/message/mqtt_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self):

def kafka_message(self, v_topic, payload):
payload[1:] = list(map(float, payload[1:]))
kafka_msg = {'nid': int(v_topic[1]), 'sid': int(payload[0]), 'values': payload[1:],
kafka_msg = {'node_id': int(v_topic[1]), 'sensor_id': int(payload[0]), 'values': payload[1:],
'timestamp': str(datetime.datetime.now())[0:19]}
temp = json.dumps(kafka_msg).encode('utf-8')
return temp
Expand Down
2 changes: 1 addition & 1 deletion app/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def send_message_to_kafka(msg):
topic_manager.add_ping_state(v_topic[1])
print("data by mqtt: sending message to kafka : %s" % msg)
print(kafka_message)
producer.send("sensors", kafka_message)
producer.send("sensor-data", kafka_message)


# callbacks
Expand Down

0 comments on commit 93bbf5b

Please sign in to comment.