-
Notifications
You must be signed in to change notification settings - Fork 2
Message Specification
v0.1.0
This document outlines the specification for messages passed around with MessageHub. The messages are all strings of JSON
For a message to be parsed it must abide to the following:
- Follows the JSON object format defined in RFC7159
- There are two required keys at the root of the object:
- header
- body
- The two keys at the root must have an object as the value
- All following key and value pairs must be strings. Any other value type will cause errors
- Header must include the return address and sender identity
The header contain meta data for every message. The header includes specific keys that are accessed to determine how to process the message. Only two keys are required by MessageHub and the rest are optional. The required keys are add automatically if using MessageControl to send messages. Also it required that all values are strings only.
Required Keys:
- returnAddr - this contains the address which any replies should go
- identity - this is the identity of the sender
Other Optional Keys:
- type - specifies the type of message being sent
- to - specifies the message destination
- error - specify an error if present
The are some message types that are reserved for internal use:
- HANDSHAKE
- SHAKEHAND
- MONITOR
- SYSTEM
The body does not have set requirements except for all values being strings only. The data required by applications will reside in this section. Therefore the specification for the body is entirely up to the user.
{
"header": {
"returnAddr": "192.168.1.1:56789",
"identity": "computer1"
}
"body": {
"text": "Hello World!"
}
}
A HubMonitor is a centralized node that collects information from the other nodes within the network. To allow any node to register itself with the monitor a specific process must be outlined by specifying the message contents.
Header The header will contain the following:
- A message type of
MONITOR - The return address (
returnAddr) must be the actual host instead of a proxy
Body The body contains the information of the host machine. There is no required field, but the more information provided the better effective the monitor will be.
The body can contain the following:
- cpu_type
- cpu_speed (ghz )
- cpu_cores
- cpu_usage (%)
- memory_total (GB)
- memory_free (GB)
- memory_used (GB)
- network_in (Kbps)
- network_out (Kbps)
- queue_size
- queue_latency (ms)
- disk_size (GB)
- disk_usage (Kbps)
- disk_free
- disk_used
- error_type
- error_message
- error_status
- status
There is an ability to add you own custom keys to the HubMonitor