Skip to content

Commit d15086e

Browse files
committed
Regen code
1 parent cf0f46d commit d15086e

File tree

25 files changed

+62
-81
lines changed

25 files changed

+62
-81
lines changed

mqtt-examples/src/main/groovy/io/vertx/example/mqtt/app/client.groovy

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ import io.vertx.core.buffer.Buffer
55
import io.netty.handler.codec.mqtt.MqttQoS
66
@Field def MQTT_MESSAGE = "Hello Vert.x MQTT Client"
77
@Field def BROKER_HOST = "localhost"
8-
@Field def BROKER_PORT = 1883
98
@Field def MQTT_TOPIC = "/my_topic"
9+
@Field def BROKER_PORT = 1883
1010
def options = [
11-
port:BROKER_PORT,
12-
host:BROKER_HOST,
1311
keepAliveTimeSeconds:2
1412
]
1513

@@ -22,7 +20,7 @@ client.publishHandler({ publish ->
2220
})
2321

2422
// handle response on subscribe request
25-
client.subscribeCompleteHandler({ h ->
23+
client.subscribeCompletionHandler({ h ->
2624
println("Receive SUBACK from server with granted QoS : ${h.grantedQoSLevels()}")
2725

2826
// let's publish a message to the subscribed topic
@@ -37,7 +35,7 @@ client.subscribeCompleteHandler({ h ->
3735
})
3836

3937
// handle response on unsubscribe request
40-
client.unsubscribeCompleteHandler({ h ->
38+
client.unsubscribeCompletionHandler({ h ->
4139
println("Receive UNSUBACK from server")
4240
vertx.setTimer(5000, { l ->
4341
client.disconnect({ d ->
@@ -47,7 +45,7 @@ client.unsubscribeCompleteHandler({ h ->
4745
})
4846

4947
// connect to a server
50-
client.connect({ ch ->
48+
client.connect(BROKER_PORT, BROKER_HOST, { ch ->
5149
if (ch.succeeded()) {
5250
println("Connected to a server")
5351
client.subscribe(MQTT_TOPIC, 0)

mqtt-examples/src/main/groovy/io/vertx/example/mqtt/app/server.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ mqttServer.endpointHandler({ endpoint ->
4444

4545
endpoint.publishRelease(messageId)
4646

47-
}).publishCompleteHandler({ messageId ->
47+
}).publishCompletionHandler({ messageId ->
4848

4949
println("Received ack for message = ${messageId}")
5050
})

mqtt-examples/src/main/groovy/io/vertx/example/mqtt/simple/client.groovy

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@ import io.netty.handler.codec.mqtt.MqttQoS
66
@Field def BROKER_HOST = "localhost"
77
@Field def BROKER_PORT = 1883
88
@Field def MQTT_TOPIC = "/my_topic"
9-
def options = [
10-
port:BROKER_PORT,
11-
host:BROKER_HOST
12-
]
9+
def mqttClient = MqttClient.create(vertx)
1310

14-
def mqttClient = MqttClient.create(vertx, options)
15-
16-
mqttClient.connect({ ch ->
11+
mqttClient.connect(BROKER_PORT, BROKER_HOST, { ch ->
1712
if (ch.succeeded()) {
1813
println("Connected to a server")
1914

mqtt-examples/src/main/groovy/io/vertx/example/mqtt/ssl/client.groovy

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ import io.netty.handler.codec.mqtt.MqttQoS
77
@Field def BROKER_PORT = 8883
88
@Field def MQTT_TOPIC = "/my_topic"
99
def options = [:]
10-
options.port = BROKER_PORT
11-
options.host = BROKER_HOST
1210
options.ssl = true
1311
options.trustAll = true
1412

1513
def mqttClient = MqttClient.create(vertx, options)
1614

17-
mqttClient.connect({ ch ->
15+
mqttClient.connect(BROKER_PORT, BROKER_HOST, { ch ->
1816
if (ch.succeeded()) {
1917
println("Connected to a server")
2018

mqtt-examples/src/main/js/io/vertx/example/mqtt/app/client.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ var MqttClient = require("vertx-mqtt-server-js/mqtt_client");
33
var Buffer = require("vertx-js/buffer");
44
var MQTT_MESSAGE = "Hello Vert.x MQTT Client";
55
var BROKER_HOST = "localhost";
6-
var BROKER_PORT = 1883;
76
var MQTT_TOPIC = "/my_topic";
7+
var BROKER_PORT = 1883;
88
var options = {
9-
"port" : BROKER_PORT,
10-
"host" : BROKER_HOST,
119
"keepAliveTimeSeconds" : 2
1210
};
1311

@@ -20,7 +18,7 @@ client.publishHandler(function (publish) {
2018
});
2119

2220
// handle response on subscribe request
23-
client.subscribeCompleteHandler(function (h) {
21+
client.subscribeCompletionHandler(function (h) {
2422
console.log("Receive SUBACK from server with granted QoS : " + h.grantedQoSLevels());
2523

2624
// let's publish a message to the subscribed topic
@@ -35,7 +33,7 @@ client.subscribeCompleteHandler(function (h) {
3533
});
3634

3735
// handle response on unsubscribe request
38-
client.unsubscribeCompleteHandler(function (h) {
36+
client.unsubscribeCompletionHandler(function (h) {
3937
console.log("Receive UNSUBACK from server");
4038
vertx.setTimer(5000, function (l) {
4139
client.disconnect(function (d, d_err) {
@@ -45,7 +43,7 @@ client.unsubscribeCompleteHandler(function (h) {
4543
});
4644

4745
// connect to a server
48-
client.connect(function (ch, ch_err) {
46+
client.connect(BROKER_PORT, BROKER_HOST, function (ch, ch_err) {
4947
if (ch_err == null) {
5048
console.log("Connected to a server");
5149
client.subscribe(MQTT_TOPIC, 0);

mqtt-examples/src/main/js/io/vertx/example/mqtt/app/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ mqttServer.endpointHandler(function (endpoint) {
4343

4444
endpoint.publishRelease(messageId);
4545

46-
}).publishCompleteHandler(function (messageId) {
46+
}).publishCompletionHandler(function (messageId) {
4747

4848
console.log("Received ack for message = " + messageId);
4949
});

mqtt-examples/src/main/js/io/vertx/example/mqtt/simple/client.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ var MQTT_MESSAGE = "Hello Vert.x MQTT Client";
44
var BROKER_HOST = "localhost";
55
var BROKER_PORT = 1883;
66
var MQTT_TOPIC = "/my_topic";
7-
var options = {
8-
"port" : BROKER_PORT,
9-
"host" : BROKER_HOST
10-
};
7+
var mqttClient = MqttClient.create(vertx);
118

12-
var mqttClient = MqttClient.create(vertx, options);
13-
14-
mqttClient.connect(function (ch, ch_err) {
9+
mqttClient.connect(BROKER_PORT, BROKER_HOST, function (ch, ch_err) {
1510
if (ch_err == null) {
1611
console.log("Connected to a server");
1712

mqtt-examples/src/main/js/io/vertx/example/mqtt/ssl/client.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ var BROKER_PORT = 8883;
66
var MQTT_TOPIC = "/my_topic";
77
var options = {
88
};
9-
options.port = BROKER_PORT;
10-
options.host = BROKER_HOST;
119
options.ssl = true;
1210
options.trustAll = true;
1311

1412
var mqttClient = MqttClient.create(vertx, options);
1513

16-
mqttClient.connect(function (ch, ch_err) {
14+
mqttClient.connect(BROKER_PORT, BROKER_HOST, function (ch, ch_err) {
1715
if (ch_err == null) {
1816
console.log("Connected to a server");
1917

mqtt-examples/src/main/kotlin/io/vertx/example/mqtt/app/Client.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ import io.vertx.mqtt.MqttClientOptions
1010
class Client : io.vertx.core.AbstractVerticle() {
1111
var MQTT_MESSAGE = "Hello Vert.x MQTT Client"
1212
var BROKER_HOST = "localhost"
13-
var BROKER_PORT = 1883
1413
var MQTT_TOPIC = "/my_topic"
14+
var BROKER_PORT = 1883
1515
override fun start() {
1616
var options = MqttClientOptions(
17-
port = BROKER_PORT,
18-
host = BROKER_HOST,
1917
keepAliveTimeSeconds = 2)
2018

2119
var client = MqttClient.create(Vertx.vertx(), options)
@@ -27,7 +25,7 @@ class Client : io.vertx.core.AbstractVerticle() {
2725
})
2826

2927
// handle response on subscribe request
30-
client.subscribeCompleteHandler({ h ->
28+
client.subscribeCompletionHandler({ h ->
3129
println("Receive SUBACK from server with granted QoS : ${h.grantedQoSLevels()}")
3230

3331
// let's publish a message to the subscribed topic
@@ -42,7 +40,7 @@ class Client : io.vertx.core.AbstractVerticle() {
4240
})
4341

4442
// handle response on unsubscribe request
45-
client.unsubscribeCompleteHandler({ h ->
43+
client.unsubscribeCompletionHandler({ h ->
4644
println("Receive UNSUBACK from server")
4745
vertx.setTimer(5000, { l ->
4846
client.disconnect({ d ->
@@ -52,7 +50,7 @@ class Client : io.vertx.core.AbstractVerticle() {
5250
})
5351

5452
// connect to a server
55-
client.connect({ ch ->
53+
client.connect(BROKER_PORT, BROKER_HOST, { ch ->
5654
if (ch.succeeded()) {
5755
println("Connected to a server")
5856
client.subscribe(MQTT_TOPIC, 0)

mqtt-examples/src/main/kotlin/io/vertx/example/mqtt/app/Server.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Server : io.vertx.core.AbstractVerticle() {
4949

5050
endpoint.publishRelease(messageId)
5151

52-
}).publishCompleteHandler({ messageId ->
52+
}).publishCompletionHandler({ messageId ->
5353

5454
println("Received ack for message = ${messageId}")
5555
})

0 commit comments

Comments
 (0)