Hello, I have just begun using openHAB 2 to develop a binding that uses paho mqtt java library. So far, I can successfully publish messages . However, I am not receiving anything from the broker although the broker is sending messages ( tested with python script ). Obviously, I am missing something. Please guide me through this.
Callback
client.setCallback(new MqttCallback()
{
@Override
public void messageArrived(String topic, MqttMessage message) throws Exception
{
logger.debug("MQTT message received.");
}
@Override
public void deliveryComplete(IMqttDeliveryToken arg0)
{
// TODO Auto-generated method stub
}
@Override
public void connectionLost(Throwable arg0)
{
// TODO Auto-generated method stub
}
});
Connection / Subscription
client.connect();
client.subscribe(topic);