Skip to content

Send Direct Message

sqrtofsaturn edited this page Apr 4, 2016 · 5 revisions

Sending a message from device to device creates a series of jobs in Meshblu Core.

Basic Rules:

  • Only publish to Redis in *Received jobs
  • Subscription* jobs can only create other Subscription* jobs
  • *Receieved jobs can only create *Received jobs

Scenario: Device B allows A to send a message

Meshblu Message

devices: ["B"]
payload: "HI"

Device B Configuration

meshblu:
  whitelists:
    message:
      from: A: {}

Subscriptions

A Device must explicitly subscribe to any message type it wants to receive in the Firehose.

emitterUuid: "B"
subscriberUuid: "B"
type: "message.received"

Scenario: Device B allows A to send a message, Device C is subscribed to B

Device C is subscribed to B to get message.received. DeliverSubscriptionMessageReceived will look for any subscriptions where the emitterUuid is B and generate more DeliverSubscriptionMessageReceived jobs.

Device B Configuration

meshblu:
  whitelists:
    message:
      from: A: {}
      received: C: {}

Subscriptions

emitterUuid: "B"
subscriberUuid: "C"
type: "message.received"

Scenario: Device B allows A to send a message, Device D is subscribed to A

Device D is subscribed to A to get message.sent. DeliverSubscriptionMessageSent will look for any subscriptions where the emitterUuid is A and generate more DeliverSubscriptionMessageReceived jobs.

Device A Configuration

meshblu:
  whitelists:
    message:
      sent: D: {}

Subscriptions

emitterUuid: "A"
subscriberUuid: "D"
type: "message.sent"

emitterUuid: "D"
subscriberUuid: "D"
type: "message.received"