WSO2: MQTT input event adapter is not listening

85 Views Asked by At

I am using WSO2 CEP 4.2.0 and have created MQTT input event adapter. I have also created the receiver which will receive the data from a external topic and then using streams, I am adding some logics and then same message will be published using publishers to another external topic.

Now, When I restart the application, I get below two messages:

INFO {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime} -  Connecting receiver mqttreceiver_test
INFO {org.wso2.carbon.event.input.adapter.mqtt.internal.util.MQTTAdapterListener} -  MQTT Connection successful

And then When I am publishing the message from external mqtt client, I can see that message arrives the event receiver and after stream processing, the message goes to output event publisher.

But after approx 5 mins, the messages are not received any more in the event receiver. I do not get any error message also in logs but what I could sense is may be the input adapter is not listening any more. Any suggestions or any guidance will help.

Thanks

1

There are 1 best solutions below

1
Dilini On

Few things I could suggest to debug this issue:

  1. Perhaps the flow is broken so that the event does not reach the output event publisher? You could use logger event publisher [1] and log the stream that is generated by the MQTT input event adapter.
  2. Enable debug logs for package org.wso2.carbon.event.input.adapter.mqtt.internal.util so that you will see a log when the MQTTAdapterListener receives a message (See [2] ). You can follow [3] to enable debug logs.
  3. When the issue happens, take a thread dump and see whether the MQTTAdapterListener thread is running.

Hope these will help you to narrow down the issue.

[1] https://docs.wso2.com/display/CEP420/Logger+Event+Publisher

[2] https://github.com/wso2/carbon-analytics-common/blob/v5.1.3/components/event-receiver/event-input-adapters/org.wso2.carbon.event.input.adapter.mqtt/src/main/java/org/wso2/carbon/event/input/adapter/mqtt/internal/util/MQTTAdapterListener.java#L150

[3] https://docs.wso2.com/display/CEP420/Logging