From c9dbf58737e4f37643fe5d5124ce3f634245f18a Mon Sep 17 00:00:00 2001 From: andrea Date: Sat, 8 Feb 2014 19:39:19 +0100 Subject: [PATCH] Removed a silencer try..catch --- .../messaging/spi/impl/ProtocolProcessor.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/broker/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/ProtocolProcessor.java b/broker/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/ProtocolProcessor.java index f67d6953..aaade00e 100644 --- a/broker/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/ProtocolProcessor.java +++ b/broker/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/ProtocolProcessor.java @@ -261,6 +261,9 @@ class ProtocolProcessor implements EventHandler { //QoS 0 sendPublish(sub.getClientId(), topic, qos, message, false); } else { + //TODO BUG if the sub is not active the code and the cleanSession is true + //then publish to the subscriber (that is not active) + //QoS 1 or 2 //if the target subscription is not clean session and is not connected => store it if (!sub.isCleanSession() && !sub.isActive()) { @@ -301,20 +304,16 @@ class ProtocolProcessor implements EventHandler { pubMessage.setMessageID(messageID); } - try { - if (m_clientIDs == null) { - throw new RuntimeException("Internal bad error, found m_clientIDs to null while it should be initialized, somewhere it's overwritten!!"); - } - LOG.debug("clientIDs are {}", m_clientIDs); - if (m_clientIDs.get(clientId) == null) { - throw new RuntimeException(String.format("Can't find a ConnectionDescriptor for client <%s> in cache <%s>", clientId, m_clientIDs)); - } - LOG.debug("Session for clientId {} is {}", clientId, m_clientIDs.get(clientId).getSession()); -// m_clientIDs.get(clientId).getSession().write(pubMessage); - disruptorPublish(new OutputMessagingEvent(m_clientIDs.get(clientId).getSession(), pubMessage)); - } catch(Throwable t) { - LOG.error(null, t); + if (m_clientIDs == null) { + throw new RuntimeException("Internal bad error, found m_clientIDs to null while it should be initialized, somewhere it's overwritten!!"); } + LOG.debug("clientIDs are {}", m_clientIDs); + if (m_clientIDs.get(clientId) == null) { + throw new RuntimeException(String.format("Can't find a ConnectionDescriptor for client <%s> in cache <%s>", clientId, m_clientIDs)); + } + LOG.debug("Session for clientId {} is {}", clientId, m_clientIDs.get(clientId).getSession()); +// m_clientIDs.get(clientId).getSession().write(pubMessage); + disruptorPublish(new OutputMessagingEvent(m_clientIDs.get(clientId).getSession(), pubMessage)); } private void sendPubRec(String clientID, int messageID) {