code: private void publish2Subscribers(String topic, AbstractMessage.QOSType qos, ByteBuffer origMessage, boolean retain, Integer messageID) {
          Log.trace("publish2Subscribers republishing to existing subscribers that matches the topic {}", topic);
          if (Log.DEBUG) {
              Log.trace("content <{}>", DebugUtils.payload2Str(origMessage));
              Log.trace("subscription tree {}", subscriptions.dumpTree());
          }
          for (final Subscription sub : subscriptions.matches(topic)) {
              if(m_clientIDs.get(sub.getClientId()) == null) {
                  subscriptions.removeSubscription(topic, sub.getClientId());
                  continue;
              }
              if (qos.ordinal() > sub.getRequestedQos().ordinal()) {
                  qos = sub.getRequestedQos();
              }
  
              ByteBuffer message = origMessage.duplicate();
  
              if (qos == AbstractMessage.QOSType.MOST_ONE && sub.isActive()) {
                  //QoS 0
                  sendPublish(sub.getClientId(), topic, qos, message, false);
              } else {
                  //QoS 1 or 2
                  //if the target subscription is not clean session and is not connected => store it
                  if (!sub.isCleanSession() && !sub.isActive()) {
                      //clone the event with matching clientID
                      PublishEvent newPublishEvt = new PublishEvent(topic, qos, message, retain, sub.getClientId(), messageID);
                      m_storageService.storePublishForFuture(newPublishEvt);
                  } else  {
                      //if QoS 2 then store it in temp memory
                      if (qos ==AbstractMessage.QOSType.EXACTLY_ONCE) {
                          String publishKey = String.format("%s%d", sub.getClientId(), messageID);
                          PublishEvent newPublishEvt = new PublishEvent(topic, qos, message, retain, sub.getClientId(), messageID);
                          m_storageService.addInFlight(newPublishEvt, publishKey);
                      }
                      //publish
                      if (sub.isActive()) {
                          sendPublish(sub.getClientId(), topic, qos, message, false);
                      }
                  }
              }
          }
      }
docs: Flood the subscribers with the message to notify. MessageID is optional and should only used for QoS 1 and 2