MQTT Client Package - Go Language

Clone this repo:
  1. 617c801 Allow setting of channel depth for queued outgoing messages while reconnecting. by Al S-M · 3 years, 8 months ago master
  2. 5687bf8 Throw away qos 0 messages published while reconnecting by Al S-M · 3 years, 8 months ago
  3. e633e4a Use proper Timer for ping and have a flexible timer for ping response from server. by Al S-M · 3 years, 8 months ago
  4. dbd8d5c Get the seconds value of the KeepAlive value for connect packet by Al S-M · 3 years, 11 months ago
  5. 755e3fc Resolve potential race between sending pingreq and receiving pingresp by Al S-M · 4 years ago

Eclipse Paho MQTT Go client

This repository contains the source code for the Eclipse Paho MQTT Go client library.

This code builds a library which enable applications to connect to an MQTT broker to publish messages, and to subscribe to topics and receive published messages.

This library supports a fully asynchronous mode of operation.

Installation and Build

This client is designed to work with the standard Go tools, so installation is as easy as:

go get

The client depends on Google's websockets package, also easily installed with the command:

go get

Usage and API

Detailed API documentation is available by using to godoc tool, or can be browsed online using the service.

Make use of the library by importing it in your Go client source code. For example,

import MQTT ""

Samples are available in the /samples directory for reference.

Runtime tracing

Tracing is enabled by assigning logs (from the Go log package) to the logging endpoints, ERROR, CRITICAL, WARN and DEBUG

Reporting bugs

Please report bugs under the “MQTT-Go” Component in Eclipse Bugzilla for the Paho Technology project. This is a very new library as of Q1 2014, so there are sure to be bugs.

More information

Discussion of the Paho clients takes place on the Eclipse paho-dev mailing list.

General questions about the MQTT protocol are discussed in the MQTT Google Group.

There is much more information available via the MQTT community site.