Pixotope API - Message Scheme
Message structure
Every ZeroMQ message is split up into
Topic | JSON like string without spaces or line breaks and in strict order
|
Message | JSON
|
The Topic field is designed to be easily filterable no matter what your service is trying to do. Learn more about how to Subscribe to Topics
Easily test ZeroMQ messages using the Pixotope explorer - see Pixotope developer tools

Service names
"1 per machine" service |
|
Singleton or wildcard service |
|
Learn more about the available Pixotope Services
Parameter names
Type | Message type |
Target | Name of a specific service this message targets OR "BROADCAST" |
RespondTo | Name of a specific service to which the response should be targeted to |
Source | Name of a specific service this message originates from |
Name | Setting on a service (in case of a JSON by using the dot (.) notation) |
Value | Value of a setting on a service NOTE: this value can be either a JSON or a single value |
Message types
Get
Get state or non-state value from the service
Command used to fetch the current value of a state or non-state value on a Service. Try to avoid continuous polling, instead subscribe to Update-messages and just listen to changes.
Template
Topic |
|
Message |
|
Example
Topic |
|
Message |
|
When Receiving
When you are receiving this someone is asking about the state or a non-state value.
Return the value via an Update-command targeted to them
If you don’t have this value, return
"Value":"null"
in the messageoptionally send a log message of type Warning (more on the Log command below).
Set
Request change of state or non-state values on the service
Command used by a Service that attempts to change the state or a non-state value of another service. It is not guaranteed to have any effect and does not include information about the sender. You can set things inside the state struct or on specific exposed values.
Template
Topic |
|
Message |
|
Example 1
Topic |
|
Message |
|
Example 2
Topic |
|
Message |
|
When Receiving
When someone sends this message they probably expect you to change your singleton state, part of it, or something else to the new value. If you do that (you are also free to refuse it), remember to send an Update command afterwards (more on Update below).
Reset
Request that service state returns to default
Command used to reset the state of a Service to default.
Template
Topic |
|
Message |
|
Example
Topic |
|
Message |
|
When Receiving
When you are receiving this, there is likely some disconnection of the current context happening.
Reset or return to a "baseline" and/or a generic start state
When setting this default state, remember to send an Update-message to notify listeners
Update
Returned on a Get request and when state or non-state variables change
Used when the state of a Service changes. This command should be sent every time there is a change. Services decide whether they want to listen to these updates or not.
It is also sent as a response to a Get request. In this case the "RespondTo"-field of the Get request is used as the "Target" of the Update message.
Template
Topic |
|
Message |
|
Example 1
Topic |
|
Message |
|
Example 2
Topic |
|
Message |
CODE
|
Example 3
Topic |
|
Message |
|
When Receiving
When receiving this message, it means a value you had subscribed to has been updated or a value you have asked for has been retrieved.
It’s up to you if you want to do something with this or not, but if you don’t you probably want to unsubscribe in order to not waste network resources.
Identify
Constantly ticking heartbeat to see what services are connected and responsive
Used by the central server to get information about connected Services, if you don’t respond you won't be considered connected (and won’t appear in Store’s ConnectedClients).
Template
Topic |
|
Message |
|
Example 1
Topic |
|
Message |
|
Example 2
Topic |
|
Message |
|
When Receiving
When receiving this message you should respond with a Self command to the one asking, or other services won’t be able to find you (more on the Self command below).
Self
Service response to Identify
Sent as an answer to the Identify-request OR directly when coming online to avoid having to wait for the next heartbeat before coming online.
Note: If you have a state, use the Startup command instead.
In this case "Role" is referring to the name of the service, for example "Engine".
Template
Topic |
|
Message |
|
Example
Topic |
|
Message |
|
When Receiving
Only Store is expected to receive this message, if you should receive it (as a normal Service) you probably want to unsubscribe.
Startup
Sent on connection by a service that maintains a state triggering data fetching from "Store"
Sent by any service that maintains a State when connecting to a network. This will make "Store" go through its memory, find the proper settings for the current Show that you should use and send that to you as a Set message.
Template
Topic |
|
Message |
|
Example
Topic |
|
Message |
|
When Receiving
Only "Store" is expected to receive this message, if you should receive it (as a normal Service) you probably want to unsubscribe.
Log
Logs over DH2
Logging over the network. "Message" and "Code" are always strings. The Code field is optional and does not have to be included.
Template
Topic |
|
Message |
|
Example 1
Topic |
|
Message |
|
Example 2
Topic |
|
Message |
|
When Receiving
You’d only get this if you subscribed to logs from somewhere, and if you did you should have some idea of what you want to do with it.
Call
Service specific black box RPC function call. Every service can implement how many or few it desires.
Every service can define custom endpoints for executing actions (not only getting data). These RPC-style function calls can then be triggered.
A "Method" is supposed to have named parameters and follow the PascalCase naming convention.
The "ID" is a unique identifier of this specific call.
Template
Topic |
|
Message |
|
Example
Topic |
|
Message |
|
When Receiving
If the service doesn’t have any remote function calls implemented, this message can be ignored.
Otherwise, when receiving this message the service should parse the method and arguments and execute the corresponding code. Then the CallResult message should be sent as a response, targeted at the service defined in the "RespondTo" field of the original Call message, passing through the received "ID".
CallResult
Response to a Call
Communicates a result of an RPC executed with a Call command. Depending on whether the original call succeeded or failed the message should contain the "Result" or "Failure" field.
Template
Topic |
|
Message (when the call succeeded) |
|
Message (when the call failed) |
|
Example 1
Topic |
|
Message |
|
Example 2
Topic |
|
Message |
|
Example 3
Topic |
|
Message |
|
When Receiving
When receiving, it should be parsed by services interested in receiving back the results of an RPC they called.
Legend for examples
Service | example name of a Pixotope Service |
ServiceOrBroadcast | example name of a Pixotope Service OR "BROADCAST" |
SettingName | example name of a setting on a Pixotope Service |
SettingValue | example value of a setting on a Pixotope Service |