@ Override public int unregisterTopicSession ( String topic , Session session ) { if ( isInconsistenceContext ( topic , session ) ) { return 0 ; } logger . debug ( "'{}' unsubscribe to '{}'" , session . getId ( ) , topic ) ; if ( Constants . Topic . ALL . equals ( topic ) ) { for ( Map . Entry < String , Collection < Session > > entry : map . entrySet ( ) ) { Collection < Session > sessions = entry . getValue ( ) ; removeSessionToSessions ( session , sessions ) ; if ( sessions . isEmpty ( ) ) { map . remove ( entry . getKey ( ) ) ; } } } else { Collection < Session > sessions = map . get ( topic ) ; removeSessionToSessions ( session , sessions ) ; if ( sessions == null || sessions . isEmpty ( ) ) { map . remove ( topic ) ; } } return getNumberSubscribers ( topic ) ; }
Unregister session for topic . topic ALL remove session for all topics