Question on service-unavailable
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(AsyncResult.java:286)
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)
-
repo owner -
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?
-
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.
-
repo owner - changed status to resolved
-
repo owner - changed status to closed
- Log in to comment
The exception message is generated by the error type "cancel", which is specified here together with the "do not retry" text: https://xmpp.org/rfcs/rfc6120.html#stanzas-error-syntax
Maybe the receiver is offline, when you get this exception?