HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support - hivemq/hivemq-mqtt-client
dependencies { compilegroup:'com.hivemq',name:'hivemq-mqtt-client-shaded',version:'1.1.0'} Maven <project> ... <dependencies> <dependency> <groupId>com.hivemq</groupId> <artifactId>hivemq-mqtt-client-shaded</artifactId> <version>1.1.0</version> </dependency> </dependencies> ... </...
public class MQTTMain { public static void main(String[] args) { Mqtt3BlockingClient pubClient = MqttClient.builder() .useMqttVersion3() .identifier("pub") .serverHost("hostaddress") .serverPort(1883) .buildBlocking(); Mqtt3BlockingClient subClient = MqttClient.builder() .useMqttVersion...
HiveMQ Cloud broker中的WebSocket端口是8884,与通常的MQTT(TLS)端口8883不同。根据您的库,您可能需...
dependencies { compilegroup:'com.hivemq',name:'hivemq-mqtt-client-shaded',version:'1.1.2'} Maven <project> ... <dependencies> <dependency> <groupId>com.hivemq</groupId> <artifactId>hivemq-mqtt-client-shaded</artifactId> <version>1.1.2</version> </dependency> </dependencies> ... </...
. maven { url 'https://jitpack.io' } } dependencies { implementation("com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client:develop-SNAPSHOT") // snapshots for optional modules implementation(platform("com.github.hivemq.hivemq-mqtt-client:hivemq-mqtt-client-websocket:develop-SNAPSHOT")) ...