paho-akka


License

License

Categories

Categories

Akka Container Microservices Reactive libraries
GroupId

GroupId

com.sandinh
ArtifactId

ArtifactId

paho-akka_2.10
Last Version

Last Version

1.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

paho-akka
paho-akka
Project URL

Project URL

https://github.com/giabao/paho-akka
Project Organization

Project Organization

com.sandinh
Source Code Management

Source Code Management

https://github.com/giabao/paho-akka

Download paho-akka_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/com.sandinh/paho-akka_2.10/ -->
<dependency>
    <groupId>com.sandinh</groupId>
    <artifactId>paho-akka_2.10</artifactId>
    <version>1.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.sandinh/paho-akka_2.10/
implementation 'com.sandinh:paho-akka_2.10:1.1.2'
// https://jarcasting.com/artifacts/com.sandinh/paho-akka_2.10/
implementation ("com.sandinh:paho-akka_2.10:1.1.2")
'com.sandinh:paho-akka_2.10:jar:1.1.2'
<dependency org="com.sandinh" name="paho-akka_2.10" rev="1.1.2">
  <artifact name="paho-akka_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.sandinh', module='paho-akka_2.10', version='1.1.2')
)
libraryDependencies += "com.sandinh" % "paho-akka_2.10" % "1.1.2"
[com.sandinh/paho-akka_2.10 "1.1.2"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.6
org.eclipse.paho : org.eclipse.paho.client.mqttv3 jar 1.0.2
com.typesafe.akka : akka-actor_2.10 jar 2.3.14
org.log4s : log4s_2.10 jar 1.2.1

test (3)

Group / Artifact Type Version
org.scalatest : scalatest_2.10 jar 2.2.5
com.typesafe.akka : akka-testkit_2.10 jar 2.3.14
ch.qos.logback : logback-classic jar 1.1.3

Project Modules

There are no modules declared in this project.

paho-akka

Known Vulnerabilities Build Status

What?

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 http://sandinh.com, use paho-akka to replace Distributed Publish Subscribe in Cluster

Install?

paho-akka is on Maven Center

How to use

val pubsub = actorOf(Props(classOf[MqttPubSub], PSConfig(
    brokerUrl = "tcp://test.mosquitto.org:1883", //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 => ...
  }
}

Changelog

see [CHANGES.md]

Licence

This software is licensed under the Apache 2 license: http://www.apache.org/licenses/LICENSE-2.0

Copyright 2014 Sân Đình (http://sandinh.com)

Versions

Version
1.1.2
1.1.1
1.1.0