Show TOC

WebSocket Provider Message FormatLocate this document in the navigation structure

A Web service client is responsible for processing error messages from the WebSocket provider.

When you subscribe to or publish data from ESP, the WebSocket Provider sends either data or error messages. Messages from the WebSocket Provider have the following format:
{
	“version” : <int>	
“flags” : <int> 
“source” : <string>
“rows” :
[
{ "ESP_OPS" : "INSERT|UPDATE|DELETE|UPSERT|SAFEDELETE", column : value, column : value, ... },
{ "ESP_OPS" : "INSERT|UPDATE|DELETE|UPSERT|SAFEDELETE", column : value, column : value, ... },
     ... 
  ]
}
Table 1: Message Fields
Field Description
version

This is an integer field. Specify the version of the message. The only supported value is 1.

flags
The type of message. There are two possible types:
  • error - the source field of the message contains the description of the error
  • data - the source field contains the stream, and the rows field contains one or more data rows
source

This is a string field. The value of this field depends on the type of message being sent. If it is an error, this field contains the description of the error. If it is a data message, this field contains the stream name from which the message originates.

rows

The WebSocket Provider fills in this information. This field is only filled in if the message is a data message.

An array of maps. Each map consists of a column name: column value pair. You can use the predefined column named ESP_OPS to specify the operation code. Valid operation codes are INSERT, UPDATE, DELETE, UPSERT, and SAFEDELETE.