Graph management

Graphs describe who can send a message and how it is to be processed.

They are managed via the graph command of the xbusctl program.

Graph files are completed by Xbus with an ID, so that they can then be updated.

Publishing a new version of a graph

  • Remove the id field of the graph.

  • Increment the version number.

  • Send it to Xbus via the graph push command of the xbusctl program.

  • Disable the previous graph:

    • Set its status field to published.
    • Send it to Xbus via the graph push command of the xbusctl program.

Example graph descriptions

  1. Simple graph that sends any test_event to xbus-example-consumer:
name: test-graph
version: "0.1"
status: active
nodes:
- id: emitter
  sourcematch:
    eventtypes:
    - test_event
  inputs: []
  outputs:
  - default
- id: consumer
  type: consumer
  actorids: []
  roles:
  - xbus-example-consumer
  rolebroadcast: true
  sourcematch: null
  inputs:
  - default
  outputs: []
edges:
- emitter.default->consumer.default
  1. Same graph but with a matching by role (only emitters registered to the specified role may send a test_event) - note the rolebroadcast parameter being set to true in this case:
name: test-graph
version: "0.1"
status: active
nodes:
- id: emitter
  roles:
  - xbus-example-emitter
  rolebroadcast: true
  sourcematch:
    eventtypes:
    - test_event
  inputs: []
  outputs:
  - default
- id: consumer
  type: consumer
  actorids: []
  roles:
  - xbus-example-consumer
  rolebroadcast: true
  sourcematch: null
  inputs:
  - default
  outputs: []
edges:
- emitter.default->consumer.default
  1. Same as the first graph but with an explicit emitter, specified by name:
name: test-graph
version: "0.1"
status: active
nodes:
- id: emitter
  type: emitter
  actorids: []
  roles: []
  rolebroadcast: false
  sourcematch:
    eventtypes:
    - test_event
  inputs: []
  outputs:
  - default
- id: consumer
  type: consumer
  actorids: []
  roles:
  - xbus-example-consumer
  rolebroadcast: true
  sourcematch: null
  inputs:
  - default
  outputs: []
edges:
- emitter.default->consumer.default