Perform real-time operations with Vatis Streams websocket API
HTTP Gateway
) and the egress connection (via Egress Service
) that combines the two in a single, easier to manage, connection.
The connection is managed by the WS Gateway
component and it can be used as a bot ingress and egress connection, or only as an ingress connection.
The Egress Service
can be used along side with the WS Gateway
to retrieve the results of the websocket-initiated stream from multiple clients.
General workflow
Basic
or a Bearer
token. The token can be placed in either the Authorization
or Sec-WebSocket-Protocol
headers.
Authorization: Basic <basic_token>
Authorization: Bearer <basic_token>
username:password
pair. The username
is the client_id
and the password
is the client_secret
.
stream metadata
message will be sent to the client.
Otherwise, an error will be emitted and the connection will be closed.
Message schema: StreamMetadataMessageDto
Stream creation failure
EVENTS
: wrap the processor response in a metadata JSON objectRAW
: return the processor response as is, generally as a websocket binary message
The default format is EVENTS
, that will be suited for most of the use-cases.Message schema: ResponseMessageDto
RAW
format only when a binary response is expectedKeepAlive message
when the client becomes idlePing message
to the server. This will trigger a Pong message
from the serverMessage schema: KeepAliveMessageDto
ping-pong
mechanism if the library provides it. Set the ping interval to 5 seconds
Inactive connection
Idle connection
Wait for end of stream
End of stream
message.
If the client is waiting for all responses, it must wait for the End of stream
message from the server.
After sending the End of stream
message, the server will immediately close the connection.
Message schema: EndOfStreamMessageDto
Server-sent end of stream
Message schema: ErrorMessageDto
1000 - Normal Closure
codeError occurance