Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Reconnect throw exception but didn't return it to the method who wants to connect #133

Open
assafsh2 opened this issue Oct 28, 2018 · 0 comments

Comments

@assafsh2
Copy link

Hi,

I would like to connect the deepstream and to get error\exception if the action failed after X times (accroding to config).
public static void main(String[] args) {
try {
DeepstreamClient deepstreamClient = new DeepstreamClient("localhost:6020");
deepstreamClient.login();
} catch (Exception e) {
e.printStackTrace();
}
System.out.print("End");
}

Exception in thread "Timer-10" io.deepstream.DeepstreamException: CONNECTION_ERROR: Connection refused: connect
at io.deepstream.DeepstreamClientAbstract.onError(DeepstreamClientAbstract.java:59)
at io.deepstream.Connection$1.run(Connection.java:194)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)

But after X time, the thread throw exception but didn't return it to the main.
The method who call it stay alive without any response.
I think the login action should throw checked exception so we can to do something in case the deepstrem is down.

thanks,
Assaf

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant