title: How can I manage sessions with stomp protocol?
body: <p>I am developing websocket in spring boot, react environment.</p>
  <p>I am using stomp protocol and I am storing the session in concurrentHashMap().</p>
  <p>This is because if there is no subscribing session at the subscription point, data transmission stops, and when there is more than one, data must be periodically transmitted (published).</p>
  <pre><code>public final static Map&lt;String, String&gt; subscribeSessions = new ConcurrentHashMap&lt;&gt;();
  
   @Override
      public void postSend(Message&lt;?&gt; message, MessageChannel channel, boolean sent) {
  
          StompHeaderAccessor accessor = StompHeaderAccessor.wrap(message);
          String sessionId = accessor.getSessionId();
  
          switch (accessor.getCommand()) {
              case CONNECT:
                  break;
              case DISCONNECT:
                  break;
              case SUBSCRIBE:
                  if(!accessor.getDestination().contains(&quot;/user/queue&quot;)) {
                      subscribeSessions.put(accessor.getSessionId(), 
                                            accessor.getDestination());
                  }
                  break;
              case UNSUBSCRIBE:
                  subscribeSessions.remove(accessor.getSessionId());
              default:
                  break;
          }
      }
  </code></pre>
  <p>I tried to store it in hashMap as below in that one user can subscribe to multiple subscription points as shown below.
  Session A - /Topic/ex
  Session A - /topic/ex/2</p>
  <p>However, this is not possible because hashmap does not allow duplicate keys.</p>
  <p>Is there any way to solve this?</p>
  <p>Or is there a way to check how many people are subscribing to subscription points?</p>