hivemq-mqtt-client icon indicating copy to clipboard operation
hivemq-mqtt-client copied to clipboard

Mqtt5UserProperty is empty when reconnected.

Open ljwhx2002 opened this issue 2 years ago • 0 comments

here is my code: `

Mqtt5Client client=Mqtt5Client.builder() .identifier("clientId") // use a unique identifier .serverHost("127.0.0.1") // use the HiveMQ broker .serverPort(1883) .automaticReconnectWithDefaultConfig() // the client automatically reconnects .build();

    client.toBlocking().connectWith()
            .cleanStart(false)
            .willPublish(null)
            .userProperties(Mqtt5UserProperties.of(Mqtt5UserProperty.of("k1","v1")))
            .sessionExpiryInterval(TimeUnit.HOURS.toSeconds(1)) // buffer messages
            .send();

`

the server can print Mqtt5UserProperty of k1 v1 well at the first time, but empty when reconnected.

ljwhx2002 avatar Jun 08 '22 06:06 ljwhx2002