Client Status Events
The AMPS engine will publish client status events to the internal /AMPS/ClientStatus
topic whenever a client connects, issues a logon
command, disconnects, enters or removes a subscription, queries a SOW or issues a sow_delete
. AMPS sends a message if a client fails authentication. In addition, upon a disconnect, a client status message will be published for each subscription that the client had registered at the time of the disconnect. This mechanism allows any client to monitor what other clients are doing and is especially useful for publishers to determine when clients subscribe to a topic of interest.
To help identify clients, it is recommended that clients send a logon
command to the AMPS engine and specify a meaningful client name. This client name is used to identify the client within client status event messages, logging output and information on clients within the monitoring console. The client name must be unique if a transaction log is configured for the AMPS instance.
Each message published to the client status topic will contain an event
and a client_name
. Depending on the event type, the message will contain other relevant fields.
For example, the following JSON document demonstrates the message for a SOW query:
The table below defines the header fields which may be returned as part of the subscription messages to the /AMPS/ClientStatus
topic.
FIX
XML
JSON/BSON/MsgPack
Description
20062
Reason
reason
Reason for the event (if applicable). This is present on client disconnect events to record the reason that the client disconnected.
20065
Timestamp
timestamp
Timestamp at which AMPS processed the message.
20066
Event
event
Command executed by the client.
20067
ClientName
client_name
Client Name
20068
Tpc
topic
Topic for the event (if applicable).
20069
Filter
filter
Filter (if applicable).
20070
SubId
sub_id
Subscription ID (if applicable).
20071
ConnName
connection_name
Internal AMPS connection name.
20072
Options
options
The options for the subscription (if applicable).
20073
QId
query_id
The identifier for the query (if applicable).
20074
CorrelationID
correlation_id
The correlation ID of the command (if applicable).
20080
ClientAddr
client_address
The remote address of the client.
20081
AuthId
auth_id
The authenticated identity of the client (if applicable).
20082
EntitlementFilter
entitlement_filter
The entitlement filter for the command (if applicable).
Since the client status messages must be able to be serialized based on data in AMPS, the /AMPS/ClientStatus
topic is not available for message types that rely on a fixed schema, such as protobuf
or struct
, and is not available for messages that have no fixed serialization such as binary
or composite message types.
Last updated