Skip to main content

Quick Start Guide

The fastest way to try MAPS Messaging is with Docker. In just a few minutes you can start a broker, connect with a client, and send your first message.


1. Run MAPS Messaging with Docker

docker run -d   --name maps-messaging   -p 1883:1883 \   # MQTT
-p 4222:4222 \ # NATS
-p 5672:5672 \ # AMQP
-p 8080:8080 \ # REST API
mapsmessaging/server_daemon:4.0.1

This starts MAPS Messaging with defaults: MQTT on port 1883, NATS on 4222, AMQP on 5672, and the REST API on 8080.


2. Verify the Broker is Running

Check the REST API:

curl http://localhost:8080/api/v1/ping

Expected response:

{"status":"Success"}

3. Send Your First Message (MQTT Example)

Using Mosquitto clients:

# Terminal 1 – Subscribe
mosquitto_sub -h localhost -p 1883 -t "demo/topic"

# Terminal 2 – Publish
mosquitto_pub -h localhost -p 1883 -t "demo/topic" -m "Hello MAPS via MQTT!"

You should see:

Hello MAPS via MQTT!

4. Send Your First Message (NATS Example)

Using the NATS CLI:

# Terminal 1 – Subscribe
nats sub demo.topic --server nats://localhost:4222

# Terminal 2 – Publish
nats pub demo.topic "Hello MAPS via NATS!"

You should see:

[#1] Received on "demo.topic"
Hello MAPS via NATS!

5. Basic Configuration

You can mount a YAML configuration file to customize protocols, ports, and security. Example:

broker:
name: "MAPS Message Broker"
protocols:
- mqtt:
port: 1883
- nats:
port: 4222
- amqp:
port: 5672

Start the container with your config:

docker run -d   -v $(pwd)/broker.yaml:/etc/maps/broker.yaml   -p 1883:1883 -p 4222:4222 -p 5672:5672 -p 8080:8080   mapsmessaging/server_daemon:4.0.1