Get the latest official version
Apollo 1.7.1
Development Snapshot
Want to help stablize the latest and greatest nightly development build?Warnning: These builds are extremely bleeding edge!
These development builds are automatically tested and deployed by a Jenkins CI server:
Apollo 99-trunk-SNAPSHOT
The development build source code should be directly checked out from oursource code repository
MQTT client JAVA
MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.
mqtt-client provides an ASL 2.0 licensed API to MQTT. It takes care of automatically reconnecting to your MQTT server and restoring your client session if any network failures occur. Applications can use a blocking API style, a futures based API, or a callback/continuations passing API style.
Using from Maven
Add the following to your mavenpom.xmlfile.
org.fusesource.mqtt-client
mqtt-client
1.12
Using from Gradle
Add the following to your gradle file.
compile 'org.fusesource.mqtt-client:mqtt-client:1.12'
Using from any Other Build System
Download theuber jar fileand add it to your build. The uber contains all the stripped down dependencies which the mqtt-client depends on from other projects.
Using on Java 1.4
We also provide anjava 1.4 uber jar filewhich is compatible with Java 1.4 JVMs. This version of the jar does not support SSL connections since the SSLEngine class used to implement SSL on NIO was not introduced until Java 1.5.
Configuring the MQTT Connection
The blocking, future, and callback APIs all share the same connection setup. You create a new instance of theMQTTclass and configure it with connection and socket related options. At a minimum thesetHostmethod be called before attempting to connect.
MQTT mqtt = new MQTT();
mqtt.setHost("localhost", 1883);
// or
mqtt.setHost("tcp://localhost:1883");