Skip to main content

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:

{
"ClientStatus":{
"timestamp":"20160509T171919.976304Z",
"event":"sow",
"client_name":"test_client",
"connection_name":"AMPS-Sample-any-tcp-9-242891694350073019",
"correlation_id":null,
"query_id":"1",
"topic":"order",
"filter":"/item/qty > 50",
"options":"send_empties",
"sub_id":"1",
"auth_id":null,
"entitlement_filter":null
}
}

The table below defines the header fields which may be returned as part of the subscription messages to the /AMPS/ClientStatus topic.

FIXXMLJSON/BSON/MsgPackDescription
20062ReasonreasonReason for the event (if applicable). This is present on client disconnect events to record the reason that the client disconnected.
20065TimestamptimestampTimestamp at which AMPS processed the message.
20066EventeventCommand executed by the client.
20067ClientNameclient_nameClient Name
20068TpctopicTopic for the event (if applicable).
20069FilterfilterFilter (if applicable).
20070SubIdsub_idSubscription ID (if applicable).
20071ConnNameconnection_nameInternal AMPS connection name.
20072OptionsoptionsThe options for the subscription (if applicable).
20073QIdquery_idThe identifier for the query (if applicable).
20074CorrelationIDcorrelation_idThe correlation ID of the command (if applicable).
20080ClientAddrclient_addressThe remote address of the client.
20081AuthIdauth_idThe authenticated identity of the client (if applicable).
20082EntitlementFilterentitlement_filterThe entitlement filter for the command (if applicable).
info

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.