No description, website, or topics provided.
Java
Switch branches/tags
Nothing to show
Clone or download
Latest commit 99f384d Jan 4, 2017
Permalink
Failed to load latest commit information.
src/main/java/com/mapr/demo/mqtt initial commit Jan 4, 2017
.gitignore initial commit Jan 4, 2017
LICENSE initial commit Jan 4, 2017
README.md initial commit Jan 4, 2017
pom.xml initial commit Jan 4, 2017

README.md

Getting Started with MQTT and Java

This project is a simple application to show how to start your first MQTT Application.

Prerequisite

Build and run the application

1- Run the MQTT broker

For example using Mosquitto on OSX:

/usr/local/sbin/mosquitto

2- Build the project with Apache Maven:

This project is a simple Java application that runs a publisher and subscriber using the Eclipse Paho library.

$ mvn clean package

For convenience, the example programs project is set up so that the maven package target produces a single executable, /mqtt-sample, that includes all of the example programs and dependencies.

3- Run the Subscriber

The subscriber will received and print all the messages published on the iot_data topic.

$ ./target/mqtt-sample subscriber

4- Run the Publisher

Run the publisher with the following command, the second parameter is the message to publish

$ ./target/mqtt-sample publisher "My first MQTT message..."