Skip to content

Commit bb2c578

Browse files
authored
Merge pull request #22 from msgflo/mqtt_inport_name
Provide inport name on MQTT too
2 parents c20b1dd + 5ea85b4 commit bb2c578

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

msgflo/msgflo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ def _on_subscribe(self, client, userdata, mid, granted_qos):
297297

298298
def _on_message(self, client, userdata, mqtt_msg):
299299
logging.debug('got message on %s' % mqtt_msg.topic)
300-
port = "" # FIXME: map from topic back to port
300+
port = ""
301+
for inport in self.participant.definition['inports']:
302+
if inport['queue'] == mqtt_msg.topic:
303+
port = inport['id']
301304

302305
def notify():
303306
msg = Message(mqtt_msg.payload)

0 commit comments

Comments
 (0)