mirror of
https://repository.entgra.net/community/product-iots.git
synced 2025-09-16 23:32:19 +00:00
Merge pull request #122 from ayyoob/das-ext
resolve server shutdown issues
This commit is contained in:
commit
94c6f5c3d4
@ -114,10 +114,22 @@ public class MQTTEventAdapter implements InputEventAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnect() {
|
public void disconnect() {
|
||||||
|
//when mqtt and this feature both together then this method becomes a blocking method, Therefore
|
||||||
|
// have used a thread to skip it.
|
||||||
|
try {
|
||||||
|
Thread thread = new Thread(new Runnable() {
|
||||||
|
public void run() {
|
||||||
if (mqttAdapterListener != null) {
|
if (mqttAdapterListener != null) {
|
||||||
mqttAdapterListener.stopListener(eventAdapterConfiguration.getName());
|
mqttAdapterListener.stopListener(eventAdapterConfiguration.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
thread.start();
|
||||||
|
thread.join(2000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user