4 Replies Latest reply on May 16, 2007 12:38 PM by Adrian Brock

    User log in notification

    Steven Buberl Newbie

      Is it possible to have a listener or be notified so I can run some code whenever any user logs in or starts listening on to a particular queue/topic? My server posts updates to live information and I'd like to send a "refresh" message that gives them the current live data.

        • 1. Re: User log in notification
          Adrian Brock Master

          I don't really understand what you are asking for?
          What you describe is called a Topic.

          But to answer your question, write an interceptor as described on the WIKI page.

          The method on JMSServerInterceptor[Support] you want are either
          (sorry, didn't understand what you want :-):

          Login: authenticate(String, String)
          Subscription: subscribe(ConnectionToken, Subscription)

          • 2. Re: User log in notification
            Steven Buberl Newbie

            I'll clarify. My server posts live highway traffic accidents and events to topics/queues but most messages are only updates on existing event data not the full data each time. So I would like to know when some one logs in so I can send them all open events on one message. I can't use durable subscriptions on topics because that would send them lots of old data as well when my subscribers only want the live data.

            I'll look into JMSServerInterceptor. Seems like what I want.

            Thanks :-)

            • 3. Re: User log in notification
              Steven Buberl Newbie

              Quick question. Does anyone know the difference between JMSServerInterceptor's checkUser() and authenticate() methods? I know one returns a client ID and one a sesson ID but are there situations when one is called and not the other? Or are they both called at different phases?

              • 4. Re: User log in notification
                Adrian Brock Master

                checkUser() determines whether there is a preconfigured client id for the user/password
                as configured on the state manager.