eclipse-paho / eclipse-paho/paho.mqtt.java

Could not check MqttClient isAlive?

Open
#609 3 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
2.3k
Forks
919
PR merge metrics
No merged PRs in 30d

Description

Hi
I have a job with 3 threads such as READER,PROCESSOR and WRITER. Here
1. READER is a threaded MqttClient class which reads data from MQTT broker and write it on a queue.
2. Concurrently PROCESSOR(threaded) will take this data from queue and do some computation and write in to another queue.
3. Concurrently WRITER will take this data write into a database.

Here i am checking these threads in particular interval for whether it is alive or not by java isAlive() function. If any of the threads is not alive i will stop remaining threads gracefully. And i have issue with READER. The issue is even READER is threaded class , this thread will be closed soon and MqttClinet class will start other threads is the background. Since the reader thread has closed i could check the isAlive() function and i dont have reference to these background threads. So what is did id instead of isAlive() I am checking MqttClinet object isConnected() method. But this one wont resolving my requirement " to know whether MqttClient is failed or not" . Please shed some light on my understanding of how paho Mqttclient works, May be i am in wrong path.But i want to check MqttClient for failure at any cost.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.