4 Replies Latest reply on Jun 3, 2010 6:24 PM by s4smart

    Errai Client Unsubscribe

    s4smart

      I have this problem ,  where I am able to send and receive messages ,But when My Server is shut down I get the error  on the client Window

      Error Delivering message into Bus . 

      How do i call client Unsubscribe when My App  Server  is shut down or I do a republish on my server.

      BTW I did set up the following lines . Not Sure how to invoke it.

       

      bus.addUnsubscribeListener(new UnsubscribeListener() {
      public void onUnsubscribe(SubscriptionEvent event) {
      }
      });
        • 1. Re: Errai Client Unsubscribe
          cbrock

          Unfortunately, there is no specific way to detect when the app server is shut down or when a client is disconnected directly.  We use a heartbeat system to detect when the connection has been broken, and unsubscribe events will be fired at the time the housekeeper reigns those dead connections in.

          1 of 1 people found this helpful
          • 2. Re: Errai Client Unsubscribe
            s4smart

            Thanks for the reply . If its automatically detected , then is there a graceful way of not showing the error Dialog Box Window  .

            when my server goes down . if the client is connected to it

            • 3. Re: Errai Client Unsubscribe
              cbrock

              Yes, you can.  This needs to be better documented and the API will probably need to be cleaned up in the future.  But you can change the LogAdapter which is responsible for showing that default error dialog:

               

              ClientMessageBusImpl bus = (ClientMessageBusImpl) ErraiBus.get();

              bus.setLogAdapter( new MyLogAdapterImpl() );

               

              The LogAdapter interface is pretty self explainatory.

              • 4. Re: Errai Client Unsubscribe
                s4smart

                Great . That was helpful and it worked.