Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/info logging #479

Open
wants to merge 62 commits into
base: develop-2
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
feec2a7
Removed deprecated methods
SgtSilvio Nov 12, 2020
12b5853
RxClient.publish(Flowable) -> (Publisher)
SgtSilvio Nov 12, 2020
e3ecf95
Moved default constants from MqttClient -> TransportConfig
SgtSilvio Nov 12, 2020
eff5897
BlockingClient.Mqtt3/5Publishes -> Publishes
SgtSilvio Nov 12, 2020
380e37b
FlowableWithSingle.observeOnBoth -> observeBothOn
SgtSilvio Nov 12, 2020
53bcd17
Subscription.getQos -> getMaxQos
SgtSilvio Nov 12, 2020
a0275db
ssl -> tls
SgtSilvio Nov 12, 2020
b2ed27f
MqttClientTransportConfig -> MqttTransportConfig
SgtSilvio Nov 12, 2020
288cc32
MqttClientTlsConfig -> MqttTlsConfig
SgtSilvio Nov 12, 2020
4e62f54
MqttClientExecutorConfig -> MqttExecutorConfig
SgtSilvio Nov 12, 2020
b8d2e41
Mqtt5ClientAdvancedConfig -> Mqtt5AdvancedConfig
SgtSilvio Nov 13, 2020
7bf5a06
MqttClientAutoReconnect -> MqttAutoReconnect
SgtSilvio Nov 13, 2020
2a655b8
MqttClientConnectedContext/Listener -> MqttConnectedContext/Listener
SgtSilvio Nov 13, 2020
94393af
Reduced package depth of messages
SgtSilvio Nov 13, 2020
d62bab3
Updated jetrains.annotations to 20.1.0
SgtSilvio Nov 13, 2020
40b5e3a
Replaced Immutable with Unmodifiable annotation
SgtSilvio Nov 16, 2020
7746cfd
Removed empty ClientModule
SgtSilvio Nov 16, 2020
a9bdcaa
Added Range annotations
SgtSilvio Nov 17, 2020
a36cc5d
AsyncClient.Mqtt3/5SubscribeAndCallbackBuilder -> .SubscribeBuilder
SgtSilvio Nov 18, 2020
962484e
Mqtt3/5SubscribeBuilder.Publishes.Args -> .Publishes.AfterComplete
SgtSilvio Nov 18, 2020
fb951cf
Add Mqtt3SubscribeBuilderBase.Complete
SgtSilvio Nov 18, 2020
4852412
Add Mqtt3UnsubscribeBuilderBase.Complete
SgtSilvio Nov 18, 2020
97ddc5c
Add Mqtt5SimpleAuthBuilderBase.Complete
SgtSilvio Nov 18, 2020
7969953
Add MqttTopicBuilderBase.Complete
SgtSilvio Nov 18, 2020
0cd435a
Add With postfix to nested builder methods in ClientBuilder and Trans…
SgtSilvio Nov 21, 2020
9281fbd
Add With postfix to nested builder methods in Reconnector and Advance…
SgtSilvio Nov 21, 2020
f86f591
Add With postfix to nested builder methods in message builders
SgtSilvio Nov 21, 2020
5d755c9
Mqtt5RetainHandling.SEND_IF_SUBSCRIPTION_DOES_NOT_EXIST -> SEND_IF_NE…
SgtSilvio Nov 22, 2020
cb64c3b
Simplified Mqtt5RetainHandling.getCode
SgtSilvio Nov 22, 2020
ea150bc
Refactored MqttCommonReasonCode -> MqttReasonCodes
SgtSilvio Nov 22, 2020
51d455b
Remove hardcoded message instances from MQTT 3 message exceptions
SgtSilvio Nov 22, 2020
406bcef
Extend MqttClientBuilderBase from MqttTransportConfigBuilderBase
SgtSilvio Nov 23, 2020
a54b133
Remove methods from MqttClientConfig that are part of MqttTransportCo…
SgtSilvio Nov 23, 2020
a76b094
Fixed transport config builder overrides in MqttRxClientBuilderBase
SgtSilvio Nov 24, 2020
51cc65a
Mqtt3RxClient.unsubscribe: Completable -> Single<Mqtt3UnsubAck>
SgtSilvio Nov 24, 2020
188eece
Mqtt3AsyncClient.unsubscribe: CompletableFuture<Void> -> CompletableF…
SgtSilvio Nov 24, 2020
e9405c4
Mqtt3BlockingClient.unsubscribe: void -> Mqtt3UnsubAck
SgtSilvio Nov 24, 2020
aa11357
Mqtt3AsyncClient.publish: CompletableFuture<Mqtt3Publish> -> Completa…
SgtSilvio Nov 24, 2020
b196dcc
Incoming/Outgoing*Interceptor -> Inbound/Outbound*Interceptor
SgtSilvio Dec 6, 2020
235b2b7
Version to 2.0.0
SgtSilvio Dec 18, 2020
a5baef1
Removed AdvancedConfig.allowServerReAuth and changed Mqtt5EnhancedAut…
SgtSilvio Dec 19, 2020
7bd7865
Improved javadoc of auth handlers
SgtSilvio Dec 19, 2020
2859aa1
jctools.version -> 3.2.0
SgtSilvio Dec 19, 2020
3a46b33
dagger.version -> 2.30.1
SgtSilvio Dec 19, 2020
631cc71
netty.version -> 4.1.56.Final
SgtSilvio Dec 19, 2020
246d8ec
reactor.version -> 3.4.1
SgtSilvio Dec 19, 2020
001a2c4
rxjava.version -> 3.0.8
SgtSilvio Dec 19, 2020
bf881e7
Formatting
SgtSilvio Dec 19, 2020
074ab31
Updated test dependencies and gradle plugins
SgtSilvio Dec 20, 2020
d0dc865
MqttClientConfig.getClientIdentifier -> getIdentifier
SgtSilvio Dec 20, 2020
44b4dbf
com.hivemq.client -> com.hivemq.client2
SgtSilvio Dec 21, 2020
04381a4
Formatting
SgtSilvio Dec 21, 2020
31d25e6
Update dependencies
SgtSilvio Mar 13, 2021
dcb0c97
MqttWebSocketConfig.serverPath -> path
SgtSilvio Mar 13, 2021
80def8f
Added missing ", " to toAttributeString in MqttStatefulSubscribe
Sarek Mar 23, 2021
cf13f8b
Added log level trace to InternalLogger
Sarek Feb 1, 2021
d87d0b7
Added log level debug to InternalLogger
Sarek Mar 22, 2021
874e7b6
Added logs for incoming publishes
Sarek Mar 23, 2021
04187fd
Added logs for PINGREQ and PINGRESP
Sarek Mar 23, 2021
68cad61
Added logs for outgoing publishes
Sarek Mar 23, 2021
ecb866d
Added logs for SUBSCRIBE, UNSUBSCRIBE, SUBACK, UNSUBACK
Sarek Mar 23, 2021
c7774b6
Added logs for CONNECT, DISCONNECT and channel initialization
Sarek Mar 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
60 changes: 30 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -102,18 +102,18 @@ If you use Gradle, just include the following inside your `build.gradle` file.

```groovy
dependencies {
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client', version: '1.2.1'
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client2', version: '2.0.0'
}
```

For optional features you can choose to include additional modules:

```groovy
dependencies {
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client-websocket', version: '1.2.1'
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client-proxy', version: '1.2.1'
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client-epoll', version: '1.2.1'
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client-reactor', version: '1.2.1'
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client2-websocket', version: '2.0.0'
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client2-proxy', version: '2.0.0'
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client2-epoll', version: '2.0.0'
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client2-reactor', version: '2.0.0'
}
```

@@ -127,8 +127,8 @@ If you use Maven, just include the following inside your `pom.xml` file.
<dependencies>
<dependency>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client</artifactId>
<version>1.2.1</version>
<artifactId>hivemq-mqtt-client2</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
...
@@ -156,32 +156,32 @@ For optional features you can choose to include additional modules:
<dependencies>
<dependency>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client-websocket</artifactId>
<version>1.2.1</version>
<artifactId>hivemq-mqtt-client2-websocket</artifactId>
<version>2.0.0</version>
<type>pom</type>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client-proxy</artifactId>
<version>1.2.1</version>
<artifactId>hivemq-mqtt-client2-proxy</artifactId>
<version>2.0.0</version>
<type>pom</type>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client-epoll</artifactId>
<version>1.2.1</version>
<artifactId>hivemq-mqtt-client2-epoll</artifactId>
<version>2.0.0</version>
<type>pom</type>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client-reactor</artifactId>
<version>1.2.1</version>
<artifactId>hivemq-mqtt-client2-reactor</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
...
@@ -199,7 +199,7 @@ To use the shaded version just append `-shaded` to the artifact name.

```groovy
dependencies {
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client-shaded', version: '1.2.1'
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client2-shaded', version: '2.0.0'
}
```

@@ -211,8 +211,8 @@ dependencies {
<dependencies>
<dependency>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client-shaded</artifactId>
<version>1.2.1</version>
<artifactId>hivemq-mqtt-client2-shaded</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
...
@@ -232,13 +232,13 @@ repositories {
}

dependencies {
implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client:develop-SNAPSHOT'
implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client2:develop-SNAPSHOT'

// snapshots for optional modules
implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client-websocket:develop-SNAPSHOT'
implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client-proxy:develop-SNAPSHOT'
implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client-epoll:develop-SNAPSHOT'
implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client-reactor:develop-SNAPSHOT'
implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client2-websocket:develop-SNAPSHOT'
implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client2-proxy:develop-SNAPSHOT'
implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client2-epoll:develop-SNAPSHOT'
implementation 'com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client2-reactor:develop-SNAPSHOT'
}
```

@@ -257,7 +257,7 @@ dependencies {
<dependencies>
<dependency>
<groupId>com.github.hivemq.hivemq-mqtt-client</groupId>
<artifactId>hivemq-mqtt-client</artifactId>
<artifactId>hivemq-mqtt-client2</artifactId>
<version>develop-SNAPSHOT</version>
</dependency>
</dependencies>
@@ -266,39 +266,39 @@ dependencies {
<dependencies>
<dependency>
<groupId>com.github.hivemq.hivemq-mqtt-client</groupId>
<artifactId>hivemq-mqtt-client-websocket</artifactId>
<artifactId>hivemq-mqtt-client2-websocket</artifactId>
<version>develop-SNAPSHOT</version>
<type>pom</type>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.github.hivemq.hivemq-mqtt-client</groupId>
<artifactId>hivemq-mqtt-client-proxy</artifactId>
<artifactId>hivemq-mqtt-client2-proxy</artifactId>
<version>develop-SNAPSHOT</version>
<type>pom</type>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.github.hivemq.hivemq-mqtt-client</groupId>
<artifactId>hivemq-mqtt-client-epoll</artifactId>
<artifactId>hivemq-mqtt-client2-epoll</artifactId>
<version>develop-SNAPSHOT</version>
<type>pom</type>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.github.hivemq.hivemq-mqtt-client</groupId>
<artifactId>hivemq-mqtt-client-reactor</artifactId>
<artifactId>hivemq-mqtt-client2-reactor</artifactId>
<version>develop-SNAPSHOT</version>
</dependency>
</dependencies>
...
</project>
```

Change the artifact name to `hivemq-mqtt-client-shaded` to get snapshots of the shaded version.
Change the artifact name to `hivemq-mqtt-client2-shaded` to get snapshots of the shaded version.

JitPack works for all branches and also specific commits.
Just specify `<branch>-SNAPSHOT` or the first 10 digits of the commit id in the version.
@@ -735,7 +735,7 @@ API but return `Completable`.

[Semantic Versioning](https://semver.org/) is used.

All code inside `com.hivemq.client.internal` packages must not be used directly. It can change at any time and is not
All code inside `com.hivemq.client2.internal` packages must not be used directly. It can change at any time and is not
part of the public API.

Interfaces annotated with `DoNotImplement` must not be implemented. The implementation is provided by the library.
14 changes: 7 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ allprojects {
plugins.apply("com.github.sgtsilvio.gradle.metadata")

metadata {
moduleName.set("com.hivemq.client.mqtt")
moduleName.set("com.hivemq.client2.mqtt")
readableName.set("HiveMQ MQTT Client")
organization {
name.set("HiveMQ and the HiveMQ Community")
@@ -74,7 +74,7 @@ allprojects {
}

dependencies {
api("io.reactivex.rxjava2:rxjava:${property("rxjava.version")}")
api("io.reactivex.rxjava3:rxjava:${property("rxjava.version")}")
api("org.reactivestreams:reactive-streams:${property("reactive-streams.version")}")

implementation("io.netty:netty-buffer:${property("netty.version")}")
@@ -166,10 +166,10 @@ allprojects {
tasks.jar {
withConvention(aQute.bnd.gradle.BundleTaskConvention::class) {
bnd("Export-Package: " +
"com.hivemq.client.annotations.*," +
"com.hivemq.client.mqtt.*," +
"com.hivemq.client.rx.*," +
"com.hivemq.client.util.*")
"com.hivemq.client2.annotations.*," +
"com.hivemq.client2.mqtt.*," +
"com.hivemq.client2.rx.*," +
"com.hivemq.client2.util.*")
}
}

@@ -186,7 +186,7 @@ tasks.shadowJar {
}
})

val shadePrefix = "com.hivemq.client.internal.shaded."
val shadePrefix = "com.hivemq.client2.internal.shaded."
val shadeFilePrefix = shadePrefix.replace(".", "_")
relocate("io.netty", "${shadePrefix}io.netty")
relocate("META-INF/native/libnetty", "META-INF/native/lib${shadeFilePrefix}netty")
2 changes: 1 addition & 1 deletion epoll/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ plugins {
description = "Adds dependencies for the HiveMQ MQTT Client epoll module"

metadata {
moduleName.set("com.hivemq.client.mqtt.epoll")
moduleName.set("com.hivemq.client2.mqtt.epoll")
readableName.set("HiveMQ MQTT Client epoll module")
}

2 changes: 1 addition & 1 deletion examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ plugins {
description = "Examples using the HiveMQ MQTT Client"

metadata {
moduleName.set("com.hivemq.client.mqtt.examples")
moduleName.set("com.hivemq.client2.mqtt.examples")
readableName.set("HiveMQ MQTT Client examples")
}

Original file line number Diff line number Diff line change
@@ -14,11 +14,11 @@
* limitations under the License.
*/

package com.hivemq.client.mqtt.examples;
package com.hivemq.client2.mqtt.examples;

import com.hivemq.client.mqtt.datatypes.MqttQos;
import com.hivemq.client.mqtt.mqtt5.Mqtt5AsyncClient;
import com.hivemq.client.mqtt.mqtt5.Mqtt5Client;
import com.hivemq.client2.mqtt.datatypes.MqttQos;
import com.hivemq.client2.mqtt.mqtt5.Mqtt5AsyncClient;
import com.hivemq.client2.mqtt.mqtt5.Mqtt5Client;

import java.util.concurrent.TimeUnit;

Original file line number Diff line number Diff line change
@@ -14,17 +14,17 @@
* limitations under the License.
*/

package com.hivemq.client.mqtt.examples;

import com.hivemq.client.mqtt.MqttGlobalPublishFilter;
import com.hivemq.client.mqtt.datatypes.MqttQos;
import com.hivemq.client.mqtt.mqtt5.Mqtt5AsyncClient;
import com.hivemq.client.mqtt.mqtt5.Mqtt5BlockingClient;
import com.hivemq.client.mqtt.mqtt5.Mqtt5Client;
import com.hivemq.client.mqtt.mqtt5.message.connect.connack.Mqtt5ConnAck;
import com.hivemq.client.mqtt.mqtt5.message.disconnect.Mqtt5DisconnectReasonCode;
import com.hivemq.client.mqtt.mqtt5.message.subscribe.Mqtt5RetainHandling;
import com.hivemq.client.mqtt.mqtt5.message.subscribe.suback.Mqtt5SubAck;
package com.hivemq.client2.mqtt.examples;

import com.hivemq.client2.mqtt.MqttGlobalPublishFilter;
import com.hivemq.client2.mqtt.datatypes.MqttQos;
import com.hivemq.client2.mqtt.mqtt5.Mqtt5AsyncClient;
import com.hivemq.client2.mqtt.mqtt5.Mqtt5BlockingClient;
import com.hivemq.client2.mqtt.mqtt5.Mqtt5Client;
import com.hivemq.client2.mqtt.mqtt5.message.connect.Mqtt5ConnAck;
import com.hivemq.client2.mqtt.mqtt5.message.disconnect.Mqtt5DisconnectReasonCode;
import com.hivemq.client2.mqtt.mqtt5.message.subscribe.Mqtt5RetainHandling;
import com.hivemq.client2.mqtt.mqtt5.message.subscribe.Mqtt5SubAck;

import java.util.concurrent.CountDownLatch;

@@ -40,28 +40,28 @@ public static void main(final String[] args)throws InterruptedException {

final Mqtt5AsyncClient client = Mqtt5Client.builder()
.serverHost("broker.hivemq.com")
.automaticReconnectWithDefaultConfig()
.automaticReconnect()
.buildAsync();

final Mqtt5ConnAck connAck = client.toBlocking().connectWith()
.cleanStart(false) // resume a previous session
.sessionExpiryInterval(30) // keep session state for 30s
.restrictions()
.restrictionsWith()
.receiveMaximum(10) // receive max. 10 concurrent messages
.sendMaximum(10) // send max. 10 concurrent messages
.maximumPacketSize(10_240) // receive messages with max size of 10KB
.sendMaximumPacketSize(10_240) // send messages with max size of 10KB
.topicAliasMaximum(0) // the server should not use topic aliases
.sendTopicAliasMaximum(8) // use up to 8 aliases for the most used topics (automatically traced)
.applyRestrictions()
.willPublish()
.willPublishWith()
.topic("demo/topic/will")
.qos(MqttQos.EXACTLY_ONCE)
.payload("rip".getBytes())
.contentType("text/plain") // our payload is text
.messageExpiryInterval(120) // not so important, expire message after 2min if can not be delivered
.delayInterval(30) // delay sending out the will message so we can try to reconnect immediately
.userProperties() // add some user properties to the will message
.userPropertiesWith() // add some user properties to the will message
.add("sender", "demo-sender-1")
.add("receiver", "you")
.applyUserProperties()
@@ -89,7 +89,7 @@ public static void main(final String[] args)throws InterruptedException {
.retain(true)
.contentType("text/plain") // our payload is text
.messageExpiryInterval(120) // not so important, expire message after 2min if can not be delivered
.userProperties() // add some user properties to the message
.userPropertiesWith() // add some user properties to the message
.add("sender", "demo-sender-1")
.add("receiver", "you")
.applyUserProperties()
@@ -108,7 +108,7 @@ public static void main(final String[] args)throws InterruptedException {
client2.publishWith()
.topic("demo/topic/a")
.retain(true)
.userProperties()
.userPropertiesWith()
.add("sender", "demo-sender-2")
.add("receiver", "you")
.applyUserProperties()
Original file line number Diff line number Diff line change
@@ -14,11 +14,11 @@
* limitations under the License.
*/

package com.hivemq.client.mqtt.examples;
package com.hivemq.client2.mqtt.examples;

import com.hivemq.client.mqtt.mqtt5.Mqtt5BlockingClient;
import com.hivemq.client.mqtt.mqtt5.Mqtt5Client;
import com.hivemq.client.mqtt.mqtt5.lifecycle.Mqtt5ClientDisconnectedContext;
import com.hivemq.client2.mqtt.mqtt5.Mqtt5BlockingClient;
import com.hivemq.client2.mqtt.mqtt5.Mqtt5Client;
import com.hivemq.client2.mqtt.mqtt5.lifecycle.Mqtt5DisconnectedContext;

import java.time.LocalTime;
import java.util.concurrent.CompletableFuture;
@@ -42,15 +42,15 @@ public static void defaultReconnect() {

final Mqtt5BlockingClient client1 = Mqtt5Client.builder()
.serverHost("broker.hivemq.com")
.automaticReconnectWithDefaultConfig() // exponential backoff, 1s initial, doubled up to 2min, random delays +-25%
.automaticReconnect() // exponential backoff, 1s initial, doubled up to 2min, random delays +-25%
.buildBlocking();
}

public static void customizedReconnect() throws InterruptedException {

final Mqtt5BlockingClient client2 = Mqtt5Client.builder()
.serverHost("broker.hivemq.com")
.automaticReconnect()
.automaticReconnectWith()
.initialDelay(3, TimeUnit.SECONDS)
.maxDelay(10, TimeUnit.SECONDS)
.applyAutomaticReconnect()
@@ -76,12 +76,12 @@ private static void completelyCustom() {
})
// multiple DisconnectedListener can form a reconnect strategy
.addDisconnectedListener(context -> {
final Mqtt5ClientDisconnectedContext context5 = (Mqtt5ClientDisconnectedContext) context;
final Mqtt5DisconnectedContext context5 = (Mqtt5DisconnectedContext) context;
context5.getReconnector()
.reconnectWhen(getOAuthToken(), (token, throwable) -> { // first reconnect would be delayed 2s but OAuth server needs more time
if (token != null) {
context5.getReconnector().connectWith()
.simpleAuth().password(token).applySimpleAuth() // set OAuth token as password
.simpleAuthWith().password(token).applySimpleAuth() // set OAuth token as password
.applyConnect();
} else {
context5.getReconnector().reconnect(false); // cancel reconnect if OAuth query failed
Original file line number Diff line number Diff line change
@@ -14,11 +14,11 @@
* limitations under the License.
*/

package com.hivemq.client.mqtt.examples;
package com.hivemq.client2.mqtt.examples;

import com.hivemq.client.mqtt.datatypes.MqttQos;
import com.hivemq.client.mqtt.mqtt5.Mqtt5Client;
import com.hivemq.client.mqtt.mqtt5.message.publish.Mqtt5Publish;
import com.hivemq.client2.mqtt.datatypes.MqttQos;
import com.hivemq.client2.mqtt.mqtt5.Mqtt5Client;
import com.hivemq.client2.mqtt.mqtt5.message.publish.Mqtt5Publish;

/**
* Shows how to implement a request/response pattern using response topic and correlation data.
Loading
Oops, something went wrong.