guillaumebreton / mqtt-codec   1.1.0

MIT License GitHub

A scodec implementation of the mqtt protocol

Scala versions: 2.10

MQTT Codec

Circle CI

What is it ?

MQTT codec is an implementation of the MQTT Codec using scodec. It provides a set of case class and a coder/decoder to extract these clases from binary messages. It implements the MQTT 3.1 protocol specification.


All extracted messages are visible in the Message.scala file.


The project is under the MIT License. See the file.


Add the following dependency and the bintray host

resolvers += "octalmind maven" at ""
libraryDependencies += "octamind" % "mqtt-codec_2.11" % "1.1.0"


import scodec.bits.ByteVector
import octalmind.mqtt.MykioCodec

val message = hex"32080001740001020202"

val result = MQTTCodec.decode(message.toBitVector)

//result: scodec.Attempt[scodec.DecodeResult[octalmind.mqtt.Frame]] = Successful(DecodeResult(Frame(Header(3,false,QOS1,false),Publish(t,Some(1),ByteVector(3 bytes, 0x020202))),BitVector(empty)))

Release Nots

1.1.0 - Minor fixes

  • Use semantic versioning
  • Update scala version and cross compiled version to scala 2.11.6


  • First release that implement the complete protocol.


Feel free to use the github issue to submit bugs and features request.