The connection to the middleware works via Websocket. Messages are exchanged between client and middleware as JSON objects.
Register your application to receive requests and send events to other clients that connected to you.
Subscribe your client to existing applications to send requests and receive events from it.
Predefined applications
middleware
Requests are sent by the client and require at least the following fields:
application
String: Name to which registered application the message should be sentrequest-type
String: Name of the request typemessage-id
int: Client defined identifier for the message, will be echoed in the response
Once a request is sent, the middleware will return a JSON response with at least the following fields:
message-id
int: The client defined identifier specified in the requeststatus
String: Response status, will be one of the following:ok
,error
error
String: An error message accompanying an error status
Additional information may be required/returned depending on the request type.
Register your application on the middleware
Request
Name | Type | Description |
---|---|---|
name |
String | Name of your application |
Response
No additional response items.
Unregister your application from the middleware. All connect clients will be disconnected.
Request
Name | Type | Description |
---|---|---|
name |
String | Name of your application |
Response
No additional response items.
Subscrie your client to an registered application.
Request
Name | Type | Description |
---|---|---|
name |
String | Name of the application |
Response
No additional response items.
Unsubscribe your client from an subscribed application.
Request
Name | Type | Description |
---|---|---|
name |
String | Name of the application |
Response
No additional response items.
Events are broadcast by the middleware to each subscribed client of an application.
An event message will contain at least the following base field:
update-type
String: Type of the event
Additional fields may be present in the event message depending on the event type.
Client became unsubscribed from an application
Name | Type | Description |
---|---|---|
name |
String | Name of the application |