import io.crossbar.autobahn.wamp.Client;
import io.crossbar.autobahn.wamp.Session;
import io.crossbar.autobahn.wamp.types.ExitInfo;
import java.util.concurrent.CompletableFuture;
public class Main {
public static void main(String[] args) {
final String url = "ws://localhost:8080";
final String realm = "realm";
Session session = new Session();
session.addOnJoinListener((ses, details) -> System.out.println("Joined"));
session.addOnDisconnectListener((ses, clean) -> System.out.println("Disconnected"));
session.addOnLeaveListener((ses, clean) -> System.out.println("Left"));
session.addOnConnectListener((ses) -> System.out.println("Connected"));
Client client = new Client(session, url, realm);
CompletableFuture<ExitInfo> connection = client.connect();
connection.join();
System.out.println("Exiting");
}
}
<dependency>
<groupId>io.crossbar.autobahn</groupId>
<artifactId>autobahn-java</artifactId>
<version>18.5.1</version>
</dependency>
When running this code, my console logs are:Aug 02, 2018 1:16:59 PM io.crossbar.autobahn.wamp.transports.NettyWebSocketClientHandlerINFO: WebSocket Client disconnected!LeftDisconnectedExitingAt this point, the program has not terminated yet. Meaning that there still must be some unknown Thread running in the background.Furthermore, if I try to connect to the router using Autobahn|JS, it works just fine.The Crossbar router does not give any logs whatsoever. However, attempting using the Go Nexus Router, I get the following log: "Error attaching to router: did not receive HELLO: receive channel closed"Some help with this problem would be appreciated.
try {
connection.get();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
connection.thenAccept(exitInfo -> {
System.out.println("Exiting");
});
new Scanner(System.in).nextLine();
ws://localhost:8080/ws