5 Replies Latest reply on Mar 3, 2010 2:18 AM by danny_run

    MessageClientListener to view online visitors with lcds

    danny_run Level 1

      I'm using the MessageClientListener to view the visitors who are online on my application (i'm using messaging trough rtmp chanell). Everything works fine but if the user stays online a longer time the messageClientDestroyed function is not called. My implementation is like this:

       

      //my messaging service

       

      public class MyMessageService implements MessageClientListener {

       

           public IpZoneService() {
              MessageClient.addMessageClientCreatedListener(this);
          }

       

          @Override
          public void messageClientCreated(MessageClient msg) {
              msg.addMessageClientDestroyedListener(this);
              MessageClient.removeMessageClientCreatedListener(this);
          }

       

          @Override
          public void messageClientDestroyed(MessageClient msg) {       
             //some code to show that the user is no longer online
          }

       

      }

       

      My channel definition looks like this:

       

      <channel-definition id="my-rtmp"
                  class="mx.messaging.channels.RTMPChannel">
                  <endpoint url="rtmp://{server.name}:2038" class="flex.messaging.endpoints.RTMPEndpoint" />
                  <properties>
                      <idle-timeout-minutes>-1</idle-timeout-minutes>
                      <!--
                          for deployment on WebSphere, must be mapped to a WorkManager
                          available in the web application's jndi context.
                          <websphere-workmanager-jndi-name>java:comp/env/wm/MessagingWorkManager</websphere-workman ager-jndi-name>
                      -->
                 </properties>
         </channel-definition>

       

      and my message:

       

      <destination id="mainAppl">
              <properties>
                   <network>
                      <session-timeout>0</session-timeout>
                  </network>           
                  <server>
                      <allow-subtopics>true</allow-subtopics>
                      <subtopic-separator>.</subtopic-separator>           
                  </server>           
              </properties>
              <channels>
                  <channel ref="my-rtmp"/>
                  <channel ref="my-longpolling-amf"/>       
             </channels>      
      </destination>

       

      On the client side i have a consumer that subscribes to my service. Like i said everything work fine if i connect and disonnect in the first minutes. But if i stay logged in more time (more then 20-30 minutes) the messageClientDestroyed is not called. If you have any ideea please help. I sopose that it's something related with the timeouts of the sessions but i don't know what.