@Override public void start() throws Exception { MqttServerOptions options = new MqttServerOptions() .setPort(1883) .setHost("0.0.0.0");
@Override public void start() throws Exception { MqttServerOptions options = new MqttServerOptions() .setPort(8883) .setPemKeyCertOptions(new PemKeyCertOptions()
/** * Return an MQTT server instance using default options * * @param vertx Vert.x instance * @return MQTT server instance */ static MqttServer create(Vertx vertx) { return new MqttServerImpl(vertx, new MqttServerOptions()); }
/** * Return an MQTT server instance using default options * * @param vertx Vert.x instance * @return MQTT server instance */ static MqttServer create(Vertx vertx) { return new MqttServerImpl(vertx, new MqttServerOptions()); }
/** * Return an MQTT server instance using default options * * @param vertx Vert.x instance * @return MQTT server instance */ static MqttServer create(Vertx vertx) { return new MqttServerImpl(vertx, new MqttServerOptions()); }
@Bean @ConditionalOnMissingBean(MqttServerOptions.class) public MqttServerOptions mqttServerOptions() { return new MqttServerOptions() .setHost(properties.getHost()) .setPort(properties.getPort()); }
public static io.vertx.mqtt.MqttServer create(io.vertx.mqtt.MqttServer j_receiver, io.vertx.core.Vertx vertx, java.util.Map<String, Object> options) { return io.vertx.core.impl.ConversionHelper.fromObject(io.vertx.mqtt.MqttServer.create(vertx, options != null ? new io.vertx.mqtt.MqttServerOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null)); } }
public static io.vertx.mqtt.MqttServer create(io.vertx.mqtt.MqttServer j_receiver, io.vertx.core.Vertx vertx, java.util.Map<String, Object> options) { return io.vertx.core.impl.ConversionHelper.fromObject(io.vertx.mqtt.MqttServer.create(vertx, options != null ? new io.vertx.mqtt.MqttServerOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null)); } }
@Before public void before(TestContext context) { MqttServerOptions options = new MqttServerOptions(); options.setMaxMessageSize(MQTT_MAX_MESSAGE_SIZE); this.setUp(context, options); }
@Before public void before(TestContext context) { MqttServerOptions options = new MqttServerOptions(); options.setTimeoutOnConnect(MQTT_TIMEOUT_ON_CONNECT); this.setUp(context, options); }
@Before public void before(TestContext context) { MqttServerOptions options = new MqttServerOptions(); options.setTimeoutOnConnect(MQTT_TIMEOUT_ON_CONNECT); this.setUp(context, options); }
@Before public void before(TestContext context) { MqttServerOptions options = new MqttServerOptions(); options.setMaxMessageSize(MQTT_MAX_MESSAGE_SIZE); this.setUp(context, options); }
private Future<Void> bindInsecureMqttServer() { if (isInsecurePortEnabled()) { final MqttServerOptions options = new MqttServerOptions(); options .setHost(getConfig().getInsecurePortBindAddress()) .setPort(determineInsecurePort()) .setMaxMessageSize(getConfig().getMaxPayloadSize()); return bindMqttServer(options, insecureServer).map(server -> { insecureServer = server; return (Void) null; }).recover(t -> { return Future.failedFuture(t); }); } else { return Future.succeededFuture(); } }
private Future<Void> bindInsecureMqttServer() { if (isInsecurePortEnabled()) { final MqttServerOptions options = new MqttServerOptions(); options .setHost(getConfig().getInsecurePortBindAddress()) .setPort(determineInsecurePort()) .setMaxMessageSize(getConfig().getMaxPayloadSize()); return bindMqttServer(options, insecureServer).map(server -> { insecureServer = server; return (Void) null; }).recover(t -> { return Future.failedFuture(t); }); } else { return Future.succeededFuture(); } }
private Future<Void> bindSecureMqttServer() { if (isSecurePortEnabled()) { final MqttServerOptions options = new MqttServerOptions(); options .setHost(getConfig().getBindAddress()) .setPort(determineSecurePort()) .setMaxMessageSize(getConfig().getMaxPayloadSize()); addTlsKeyCertOptions(options); addTlsTrustOptions(options); return bindMqttServer(options, server).map(s -> { server = s; return (Void) null; }).recover(t -> { return Future.failedFuture(t); }); } else { return Future.succeededFuture(); } }
@Before public void before(TestContext context) { MqttServerOptions options = new MqttServerOptions() .setPort(MQTT_SERVER_TLS_PORT) .setKeyCertOptions(Cert.SERVER_PEM_ROOT_CA.get()) .setSsl(true); // just useful for enabling decryption using Wireshark (which doesn't support default Diffie-Hellmann for key exchange) // options.addEnabledCipherSuite("TLS_RSA_WITH_AES_256_CBC_SHA256"); this.setUp(context, options); }
@Before public void before(TestContext context) { MqttServerOptions options = new MqttServerOptions() .setPort(MQTT_SERVER_TLS_PORT) .setKeyCertOptions(Cert.SERVER_PEM_ROOT_CA.get()) .setSsl(true); // just useful for enabling decryption using Wireshark (which doesn't support default Diffie-Hellmann for key exchange) // options.addEnabledCipherSuite("TLS_RSA_WITH_AES_256_CBC_SHA256"); this.setUp(context, options); }
@Before public void before(TestContext context) { MqttServerOptions options = new MqttServerOptions() .setPort(MQTT_SERVER_TLS_PORT) .setKeyCertOptions(Cert.SERVER_PEM_ROOT_CA.get()) .setTrustOptions(Trust.SERVER_PEM_ROOT_CA.get()) .setSsl(true) .setClientAuth(ClientAuth.REQUEST); this.setUp(context, options); }
@Before public void before(TestContext context) { MqttServerOptions options = new MqttServerOptions() .setPort(MQTT_SERVER_TLS_PORT) .setKeyCertOptions(Cert.SERVER_PEM_ROOT_CA.get()) .setTrustOptions(Trust.SERVER_PEM_ROOT_CA.get()) .setSsl(true) .setClientAuth(ClientAuth.REQUEST); this.setUp(context, options); }
@Before public void before(TestContext ctx) { PemKeyCertOptions pemKeyCertOptions = new PemKeyCertOptions() .setKeyPath("tls/server-key.pem") .setCertPath("tls/server-cert.pem"); MqttServerOptions serverOptions = new MqttServerOptions() .setPort(MQTT_SERVER_TLS_PORT) .setHost(MQTT_SERVER_HOST) .setKeyCertOptions(pemKeyCertOptions) .setSsl(true); server = MqttServer.create(vertx, serverOptions); server.exceptionHandler(t -> context.assertTrue(false)); server.endpointHandler(e -> { log.info("Client connected"); e.disconnectHandler(d -> log.info("Client disconnected")); e.accept(false); }).listen(ctx.asyncAssertSuccess()); }