mqtt-java

Simple MQTT library for java/kotlin

License

License

Categories

Categories

Java Languages
GroupId

GroupId

com.chimerapps
ArtifactId

ArtifactId

mqtt-java
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

mqtt-java
Simple MQTT library for java/kotlin
Project URL

Project URL

https://github.com/Chimerapps/mqtt-java
Source Code Management

Source Code Management

https://github.com/Chimerapps/mqtt-java

Download mqtt-java

How to add to project

<!-- https://jarcasting.com/artifacts/com.chimerapps/mqtt-java/ -->
<dependency>
    <groupId>com.chimerapps</groupId>
    <artifactId>mqtt-java</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.chimerapps/mqtt-java/
implementation 'com.chimerapps:mqtt-java:0.2.0'
// https://jarcasting.com/artifacts/com.chimerapps/mqtt-java/
implementation ("com.chimerapps:mqtt-java:0.2.0")
'com.chimerapps:mqtt-java:jar:0.2.0'
<dependency org="com.chimerapps" name="mqtt-java" rev="0.2.0">
  <artifact name="mqtt-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.chimerapps', module='mqtt-java', version='0.2.0')
)
libraryDependencies += "com.chimerapps" % "mqtt-java" % "0.2.0"
[com.chimerapps/mqtt-java "0.2.0"]

Dependencies

runtime (3)

Group / Artifact Type Version
com.squareup.okio : okio jar 2.2.2
org.jetbrains.kotlin : kotlin-stdlib-jdk7 jar 1.3.70
com.squareup.okhttp3 : okhttp jar 3.12.3

Project Modules

There are no modules declared in this project.

mqtt-java

Download

implementation 'com.chimerapps:mqtt-java:<latest version>

Small MQTT library for java

Most of the MQTT 3.1.1 spec has been implemented, with exception of keepalives (which are set to disabled now)

Example usage:

    //Create client
    val client = MqttClient.Builder("LeClient")
                .url(HttpUrl.get("http://broker.hivemq.com:8000/mqtt"))
                .connectionType(MqttClient.ConnectionType.WEBSOCKET)
                .protocolVersion(MqttProtocolVersion.VERSION_3_1_1)
                .build()
                
    client.connect(object : MqttClientListener {
                       override fun onConnected(client: MqttClient) {
                       }
           
                       override fun onConnectionFailed(client: MqttClient, result: MqttConnectionResult) {
                       }
           
                       override fun onDisconnected(error: Throwable?) {
                       }
           
                       override fun onMessage(message: MqttMessage) {
                       }
           
                       override fun onActionSuccess(token: MqttToken) {
                       }
           
                       override fun onPong() {
                       }
                   })
                   
    client.publish("/testTopic", "I like turtles".toByteArray(), qos = MqttQoS.EXACTLY_ONCE, isDup = false, retain = false)

com.chimerapps

Chimerapps

Versions

Version
0.2.0