Giter VIP home page Giter VIP logo

scala-mqtt-client's Introduction

A Scala MQTT client library Build Status Coverage Status

In the beginning...

I wanted to build a presentation of Akka. But not just a deck of slides, I wanted something to live-code with, something backed by real hardware. Maybe a Raspberry Pi. I imagined the small devices sending messages to an MQTT broker, probably Mosquitto.

To this purpose, I looked for an MQTT library which I could use with Scala, but those I found were only Java based. I thought: "Could be fun to implement the MQTT protocol directly with Akka IO. Its specification is rather short (around 42 printed pages)".

And quickly, when I came to look at how to encode/decode MQTT protocol frames, I stumbled upon Scodec. This seemed to be the encoding/decoding framework I was waiting for a long time. So I decided to give it a try...

And now

I have a basic and far from complete implementation of the thing. Frame encoding and decoding works pretty well, and it's possible to write some code to talk to Mosquitto. For examples you can have a look to the [local subscriber] (https://github.com/fcabestre/Scala-MQTT-client/blob/master/examples/src/main/scala/net/sigusr/mqtt/examples/LocalSubscriber.scala) or the local publisher. I'm starting to take it a bit more seriously. I mean, thinking of doing something that could be useful to others. But there is still a lot of work to be done:

  • Learning how other MQTT APIs are organised to polish this one
  • Managing communication back pressure with Akka IO
  • Suppoting both MQTT v3.1 and v3.1.1
  • If I dare, passing Paho conformance tests
  • And many, many, many more I can't foresee...

First release ever...

Artifacts are available at Sonatype OSS Repository Hosting service, even the SNAPSHOTS automatically built by Travis CI. To include the Sonatype repositories in your SBT build you should add,

resolvers ++= Seq(
    Resolver.sonatypeRepo("releases"),
    Resolver.sonatypeRepo("snapshots")
)

In case you want to easily give a try to this library, without the burden of adding resolvers, there is a release synced to Maven Central. In this case just add,

scalaVersion := "2.11.5"

libraryDependencies ++= Seq(
    "net.sigusr" %% "scala-mqtt-client" % "0.5.0"
)

Dependencies

  • Scala 2.11.6
  • Akka 2.3.9
  • scodec-core 1.7.1
  • Scalaz 7.1.1

License

This work is licenced under an Apache Version 2.0 license

scala-mqtt-client's People

Contributors

cridmann avatar fcabestre avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.