Fixed inactive channel propagation event through MQTTMessageLogger

This commit is contained in:
andsel
2016-12-28 22:21:33 +01:00
parent 4e2a0dbf28
commit d3116dc685
2 changed files with 9 additions and 7 deletions
@@ -385,12 +385,11 @@ public class ProtocolProcessor {
}
private void setupAutoFlusher(ChannelPipeline pipeline, int flushIntervalMs) {
AutoFlushHandler autoFlushHandler = new AutoFlushHandler(flushIntervalMs, TimeUnit.MILLISECONDS);
try {
pipeline.addAfter("idleEventHandler", "autoFlusher", autoFlushHandler);
pipeline.addAfter("idleEventHandler", "autoFlusher", new AutoFlushHandler(flushIntervalMs, TimeUnit.MILLISECONDS));
} catch (NoSuchElementException nseex) {
//the idleEventHandler is not present on the pipeline
pipeline.addFirst("autoFlusher", autoFlushHandler);
pipeline.addFirst("autoFlusher", new AutoFlushHandler(flushIntervalMs, TimeUnit.MILLISECONDS));
}
}