This is the Java MQTT client for The Things Network to receive activations and messages from IoT devices via The Things Network and send messages as well.
Depend on the artifact via Maven:
<dependency>
<groupId>org.thethingsnetwork</groupId>
<artifactId>data-mqtt</artifactId>
<version>2.1.3</version>
</dependency>
A Quick Start and full API Reference can be found in The Things Network Documentation.
A sample app is included. To run:
-
Build and cache the artifact:
mvn clean package install
-
export your region, Application ID and Access Key as environment variables.
export region="eu" export appId="my-app-id" export accessKey="my-access-key"
-
Build and run the MQTT sample:
cd samples/mqtt mvn clean compile exec:java -Dexec.mainClass="org.thethingsnetwork.samples.mqtt.App"