1 Reply Latest reply on Jan 11, 2010 11:44 AM by davestanley

    Stomp and temporary topics / queues

    julian

      I was wondering (newbie alert!) how other people would approach this:

       

      I need to be able to send a message to a user . This user may be logged on more than once on more than one terminal server, but each session of the user is a valid session. In other words, jmls may be logged onto machine 1 and machine 2.

       

      how do you send a message to this user ? Obviously, "jmls" is not a good destination, as jmls is on 2 sessions. Do you include a "sessionid" with each message, or do you actually make the topic/queue the sessionid itself ?

       

      If so, the number of queues / topics will grow rapidly. How do you remove inactive topics/queues ?

       

      All clients will be using the STOMP protocol.

       

      TIA

        • 1. Re: Stomp and temporary topics / queues
          davestanley

          Hi Julian

          You want to use a Topic, so both users will get the same message from your producer.

           

          In terms of how you implement the consumer side, its not 100% clear if both users should get the same message? but either way you have two choices:

           

          1) Use a topic per userid, so only messages for that user go to the TOPIC. If you want to use this approach you may need to use the nio transport and a destination policy with optimizedDispatch enabled to scale to large numbers of users.

           

          2) Use a single topic but use jms selectors to filter just the messages your interested in (by userid or sessionid)

           

          Hope this helps

          /Dave