case "port": if (member.getValue() instanceof Number) { obj.setPort(((Number)member.getValue()).intValue());
public void initialize() { state.status = ConnectionStatus.CONNECTING; StompClientOptions options = new StompClientOptions(); options.setHost(host); // TODO - fixme options.setSsl(useSsl); // TODO OMG - stupid bug in 3.2.1 try { Field f = TCPSSLOptions.class.getDeclaredField("ssl"); f.setAccessible(true); f.set(options, useSsl); } catch (NoSuchFieldException | IllegalAccessException e) { throw new RuntimeException(e); } options.setPort(port); // TODO - fixme options.setLogin(eventuateCredentials.getApiKeyId()); options.setPasscode(eventuateCredentials.getApiKeySecret()); options.setHeartbeat(new JsonObject().put("x", 60 * 1000).put("y", 60 * 1000)); stompClient = new MyStompClientImpl(vertx, options); stompClient.closeHandler(this::handleClose); logger.debug("Connecting..."); stompClient.connect(x -> { if (x.succeeded()) { logger.debug("Connected!"); handleConnectSucceeded(x.result()); } else { logger.error("Connect attempt failed", x.cause()); handleConnectFailed(); } }); }
public void initialize() { state.status = ConnectionStatus.CONNECTING; StompClientOptions options = new StompClientOptions(); options.setHost(host); // TODO - fixme options.setSsl(useSsl); // TODO OMG - stupid bug in 3.2.1 try { Field f = TCPSSLOptions.class.getDeclaredField("ssl"); f.setAccessible(true); f.set(options, useSsl); } catch (NoSuchFieldException | IllegalAccessException e) { throw new RuntimeException(e); } options.setPort(port); // TODO - fixme options.setLogin(eventuateCredentials.getApiKeyId()); options.setPasscode(eventuateCredentials.getApiKeySecret()); options.setHeartbeat(new JsonObject().put("x", 60 * 1000).put("y", 60 * 1000)); stompClient = new MyStompClientImpl(vertx, options); stompClient.closeHandler(this::handleClose); logger.debug("Connecting..."); stompClient.connect(x -> { if (x.succeeded()) { logger.debug("Connected!"); handleConnectSucceeded(x.result()); } else { logger.error("Connect attempt failed", x.cause()); handleConnectFailed(); } }); }