4 Replies Latest reply: Jun 3, 2010 6:24 PM by Guess What RSS

Errai Client Unsubscribe

Guess What Newbie

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
    Mike Brock Master

    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.

  • 2. Re: Errai Client Unsubscribe
    Guess What Newbie

    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
    Mike Brock Master

    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
    Guess What Newbie

    Great . That was helpful and it worked.