Package

com.sandinh.paho

akka

Permalink

package akka

Visibility
  1. Public
  2. All

Type Members

  1. case class ConnOptions(username: String = null, password: String = null, cleanSession: Boolean = CLEAN_SESSION_DEFAULT, maxInflight: Int = MAX_INFLIGHT_DEFAULT * 10, will: Publish = null) extends Product with Serializable

    Permalink

    Convenient class to generate MqttConnectOptions

    Convenient class to generate MqttConnectOptions

    username

    nullable

    password

    nullable

    cleanSession

    Sets whether the client and server should remember state across restarts and reconnects

    maxInflight

    The max inflight limits to how many messages we can send without receiving acknowledgments. Default is MAX_INFLIGHT_DEFAULT * 10

    will

    A last will and testament message (and topic, and qos) that will be set on the connection

  2. class Message extends AnyRef

    Permalink
  3. class MqttPubSub extends FSM[PSState, Unit]

    Permalink

    Notes: 1.

    Notes: 1. MqttClientPersistence will be set to null. @see org.eclipse.paho.client.mqttv3.MqttMessage#setQos(int) 2. MQTT client will auto-reconnect

  4. case class PSConfig(brokerUrl: String, _clientId: String = null, conOpt: MqttConnectOptions = ConnOptions().get, stashTimeToLive: Duration = 1.minute, stashCapacity: Int = 8000, reconnectDelayMin: FiniteDuration = 10.millis, reconnectDelayMax: FiniteDuration = 30.seconds) extends Product with Serializable

    Permalink

    brokerUrl

    ex tcp://test.mosquitto.org:1883

    _clientId

    MqttAsyncClient id. If left null, the code falls back to a generated ID.

    stashTimeToLive

    messages received when disconnected will be stash. Messages isOverdue after stashTimeToLive will be discard. See also stashCapacity

    stashCapacity

    pubSubStash will be drop first haft elems when reach this size

    reconnectDelayMin

    when received Disconnected event, we will first delay reconnectDelayMin to try Connect. + if connect success => we reinit connectCount + else => ConnListener.onFailure will send Disconnected to this FSM => we re-schedule Connect with

    delay = reconnectDelayMin * 2^connectCount
    reconnectDelayMax

    max delay to retry connecting

  5. sealed trait PSState extends AnyRef

    Permalink
  6. class Publish extends AnyRef

    Permalink

    This class wrap params for publishing to mqtt.

    This class wrap params for publishing to mqtt.

    Send an instance of this class to the MqttPubSub actor for publishing:

    pubsub ! Publish("some_topic", "12345".getBytes
  7. case class Subscribe(topic: String, ref: ActorRef, qos: Int = 0) extends Product with Serializable

    Permalink

    TODO support wildcards subscription TODO support Unsubscribe

  8. case class SubscribeAck(subscribe: Subscribe, fail: Option[Throwable]) extends Product with Serializable

    Permalink

Value Members

  1. object ByteArrayConverters

    Permalink
  2. object ConnectedState extends PSState with Product with Serializable

    Permalink
  3. object DisconnectedState extends PSState with Product with Serializable

    Permalink
  4. object MqttPubSub

    Permalink
  5. object Publish

    Permalink

Ungrouped