"...backbone-message-format.git" did not exist on "a1d6143c8580299e2fc18e4388eefabb9ed39642"

backbone-adapter-javascript

Generic adapter for the communications-backbone.

Implements:

  • client credentials grant
  • http send/receive/notify to backbone
  • websockets send and receive
  • validation of messages against a specified OpenAPI schema
  • decode/encode stubs

Install

TODO These should work once the repository is made public

Yarn

yarn add git+https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-javascript.git

NPM

npm install git+https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-javascript.git

Config

To run the adapter you need a credentials file called soar-config.json. This will be provided by the backbone operator or requested via the API.

{
  "client_id": "unique-client-id",
  "client_name": "UniqueClientName",
  "subscription": "dot.delimited.topic.subscription.#",
  "secret": "[a generated secret]"
}

Topics and Subscriptions

The topics have the following structure:

project.operator.vehicleType.vehicleID.[send|receive].messageType

Subscriptions may contain single-word wildcards (*) or multi-word wildcards (#).

Encoding and decoding

Decoding

Decoding refers to translation from the backbone message protocol into a native format for the client app to process.

All messages received from the backbone are parsed and validated against the protocol schema and then passed to the protocol decode function.

By overriding the decode function the client can define local actions to be executed when a message of a given type is received.

Encoding

Encoding refers to translation from the client app's native format into a message conforming to the backbone message protocol.

The equivalent encode method allows the client to define translations per message type to transform local data into a message conforming to the protocol schema for transmission.

Messages passed to the publish and broadcast methods should have been encoded and validated against the protocol schema.

Publish vs Broadcast

It is intended that all normal-operation messages will be published on a given topic allowing clients to choose which message topics to subscribe to.

Broadcast is provided for contingency scenarios. The intention is that in the case of a failure/abort a message can be sent to all parties which bypasses any existing messages in the publish queue.

The client implementation can chose to take no-action on decoding one of these messages but they will be made available to all clients.