Hello,
I'm currently trying to make MQTT binding works for OM2M v1.4.1, I compiled from sources to add the MQTT package and it seems to works correctly for creating ressources, as i'm receiving response from the IN when creating new ressources.
I'm currently trying to make subscription works but i have a problem when they trigger, there is an error message and no publish is made on the MQTT broker.
Broker : Mosquitto
Error message on the IN console :
Exception in thread "pool-2-thread-3" java.lang.NullPointerException
at org.eclipse.om2m.core.notifier.Notifier$NotificationWorker.run(Notifier.java:296)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Line pointed by the error message in notifier.java :
request.setContent(DataMapperSelector.getDataMapperList().get(sub.getNotificationPayloadContentType()).objToString(notification));
subscription resource (i tried different URI, none works) :
{\"m2m:rqp\" :
{\"m2m:fr\":\"admin:admin\"
,\"m2m:op\":1,\"m2m:pc\" :
{\"m2m:sub\":
{\"rn\":\"sub_ipe\"
,\"nu\": \"mqtt://192.16 8.21.237:1883/oneM2M/in-cse/admin:admin/json\"
,\"nct\":1
}
},\"m2m:rqi\":\"m_createAE3567902\"
,\"m2m:to\":\"in-cse/ipe/sub\"
,\"m2m:ty\":23
}
}
I already tried to modify the "nu", putting "mqtt://192.168.2 1.237:1883"
or other path to some arbitrary topics.
Content Instance resource ( sent from postman ) :
<m2m:cin xmlns:m2m="http://www.one m2m.org/xml/protocols">
<cnf>text/plains:0</cnf>
<con>
test
</con>
</m2m:cin>
I have put some spaces in the URL to be able to post.
Can someone help me with this issue ?