CI Known Vulnerabilities


This is a Publish Subscribe library for akka to pub/sub to a MQTT server - ex mosquitto. paho-akka use paho as the underlying MQTT client.

We, at, use paho-akka to replace Distributed Publish Subscribe in Cluster


paho-akka is on Maven Center

How to use

val pubsub = actorOf(Props(classOf[MqttPubSub], PSConfig(
    brokerUrl = "tcp://", //all params is optional except brokerUrl
    userName = null,
    password = null,
    //messages received when disconnected will be stash. Messages isOverdue after stashTimeToLive will be discard
    stashTimeToLive = 1.minute,
    stashCapacity = 8000, //stash messages will be drop first haft elems when reach this size
    reconnectDelayMin = 10.millis, //for fine tuning re-connection logic
    reconnectDelayMax = 30.seconds

pubsub ! new Publish(topic, payload)

class SubscribeActor extends Actor {
  pubsub ! Subscribe(topic, self)

  def receive = {
    case SubscribeAck(Subscribe(`topic`, `self`, _), fail) =>
      if (fail.isEmpty) context become ready
      else logger.error(fail.get, s"Can't subscribe to $topic")

  def ready: Receive = {
    case msg: Message => ...


see []


This software is licensed under the Apache 2 license:

Copyright 2014 Sân Đình (