void processPubRel ( String clientID , int messageID ) { Log . trace ( "PUB --PUBREL--> SRV processPubRel invoked for clientID {} ad messageID {}" , clientID , messageID ) ; String publishKey = String . format ( "%s%d" , clientID , messageID ) ; PublishEvent evt = m_storageService . retrieveQoS2Message ( publishKey ) ; final String topic = evt . getTopic ( ) ; final AbstractMessage . QOSType qos = evt . getQos ( ) ; publish2Subscribers ( topic , qos , evt . getMessage ( ) , evt . isRetain ( ) , evt . getMessageID ( ) ) ; m_storageService . removeQoS2Message ( publishKey ) ; if ( evt . isRetain ( ) ) { m_storageService . storeRetained ( topic , evt . getMessage ( ) , qos ) ; } sendPubComp ( clientID , messageID ) ; }
Second phase of a publish QoS2 protocol sent by publisher to the broker . Search the stored message and publish to all interested subscribers .