I would lose some logout messages and then the contact list will display
people who already logged out but still show them online.


            connection=queueconFactory.createConnection();
            session1= connection.createSession(false,//  transaction
                        Session.AUTO_ACKNOWLEDGE);
            session2= connection.createSession(false,//  transaction
                        Session.AUTO_ACKNOWLEDGE);
          System.out.println("Authenticator running");
          
           myqueue=(ActiveMQQueue) jmslocator.getQueue("dynamicQueues/auth");
            
           String selector1="typeOfMessage='Login'";
          consumer=session1.createConsumer(myqueue,selector1);
         
         String selector2="typeOfMessage='Logout'";
          logout_consumer=session2.createConsumer(myqueue,selector2);
          consumer.setMessageListener(this);
         logout_consumer.setMessageListener(new LogoutListener());
         
          connection.start();   
       

Adrian Co wrote:
> 
> Hi,
> 
> Could you be more specific on how the results are incorrect?
> 
> StanleyH wrote:
>> hi,  
>>
>> I am trying to implement online/offline status using a queue.   I  have
>> an
>> authenticator who consumes login requests and put the screennames on a
>> queue
>> and when someone logouts the authenticator consumes the screennames on
>> that
>> queue.  I don't seem to get correct results sometimes.  I have a
>> connection
>> with two sessions -consumes login/logout using OnMessage (different
>> MessageListeners)
>>   
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/best-way-to-implement-online-status-tf2221140.html#a6162405
Sent from the ActiveMQ - User forum at Nabble.com.

Reply via email to