siddhi-io / siddhi-io-mqtt

Extension that allows to receive and publish events from/to mqtt broker.
Apache License 2.0
2 stars 35 forks source link

It seems topic parameters do not support subscription to multiple topics. #43

Open weiping-code opened 5 years ago

weiping-code commented 5 years ago

https://github.com/siddhi-io/siddhi-io-mqtt/blob/master/component/src/main/java/io/siddhi/extension/io/mqtt/source/MqttConsumer.java#L52 it,s not working when I set the topic parameter as this '/mqtt/topic1,/mqtt/topic2'. It seems topic parameters do not support subscription to multiple topics. It is necessary to separate the topic into multiple topics according to the comma when parsing the topic parameter.

mohanvive commented 5 years ago

As you mentioned, our current implement does not support to add multiple topics to the same source configuration. If you wanted to consume from multiple topics then you have to add separate source configuration for each of them..

It would be a simple fix, please send a PR if you like to contribute.