/** * Creates a {@link StompClient} using the default implementation. * * @param vertx the vert.x instance to use * @return the created {@link StompClient} */ static StompClient create(Vertx vertx) { return create(vertx, new StompClientOptions()); }
public static io.vertx.ext.stomp.StompClient create(io.vertx.ext.stomp.StompClient j_receiver, io.vertx.core.Vertx vertx, java.util.Map<String, Object> options) { return io.vertx.core.impl.ConversionHelper.fromObject(io.vertx.ext.stomp.StompClient.create(vertx, options != null ? new io.vertx.ext.stomp.StompClientOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null)); } }
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(); } }); }