Question on service-unavailable

Issue #103 closed
Markus KARG
created an issue

I have a question about the following sporadic exception I get:

java.util.concurrent.ExecutionException: rocks.xmpp.core.stanza.StanzaException: service-unavailable  -  (type 'cancel': do not retry (the error cannot be remedied))
        at java.util.concurrent.CompletableFuture.reportGet(Unknown Source)
        at java.util.concurrent.CompletableFuture.get(Unknown Source)
        at rocks.xmpp.util.concurrent.AsyncResult.get(

This sometimes (very seldom) happens when I execute the following code line: xmppClient.getManager(SoftwareVersionManager.class).getSoftwareVersion(newReceiver).get()

Certainly services can be unavailable, but what makes me wonder is the text "do not retry", because actually I simply do retry and then it works well...

Comments (5)

  1. Markus KARG reporter

    Thanks for picking this up so quickly. :-)

    In fact, the chat partner himself is offline, but the shared XMPP server is running.

    The strange this is that in the very same situation it works if I just restart the XMPP client. Weird!

    Also I wonder how the "correct" Babbler-way to deal with this exception is: It happens when performing the "get()" on AsyncResult, so is it intended that one has to catch StanzaException in case the chat partner is offline, or did I simply misunderstand the intention how this API is to be used?

  2. Christian Schudt repo owner

    Well, service-unavailable doesn't always mean that the recipient is offline, but most often it does (also in this case).

    Yes, you can call getResult() and catch the StanzaException.

  3. Log in to comment