I am trying to integrate PubNub with KaaIoT platform where the publish API is throwing the following error/exception:
Following is the code showing a sample message that I am trying to publish:
PNConfiguration pnConfiguration = new PNConfiguration();
pnConfiguration.setSubscribeKey("sub-c-7c052466-04ea-11e5-aefa-0619f8945XXX");
pnConfiguration.setPublishKey("pub-c-12a0e504-b46c-4c9c-ba5d-089ae589bYYY");
PubNub pubNub = new PubNub(pnConfiguration);
try {
HashMap<String, String> data = new HashMap<String, String>();
data.put("value", "39");
data.put("since", "07:00 AM");
pubNub.publish()
.message(data)
.channel("TEMP")
.sync();
System.exit(0);
} catch(Exception ex) {
System.out.println("Got PubNubException..." + ex.toString());
throw ex;
}
If I try this above sample code as a standalone application, it is working fine. However, inside kaaiot, it is not working. And, I am not able to make out much from the log.
Any idea what might be causing the sync method to fail?