Skip to content

Instantly share code, notes, and snippets.

View gkesharwani's full-sized avatar

Gaurav Kesharwani gkesharwani

View GitHub Profile
/**
* We can subscribe topic from here
*/
public void subscribeToTopic() {
try {
/**
* @param topic_name
* @param QOS_level (0,1,2)
* @param userContext
* @param Listener
/*
* Publisher method: publishing data over MQTT broker (RABBIT_MQ)
*/
public void publishMessage() {
publishThreadMQTT = new Thread(new Runnable() {
@Override
public void run() {
try {
if (mqttAndroidClient != null) {