Link Search Menu Expand Document

WSAck

Table of contents

  1. WSAck
    1. Example
    2. Field Descriptions
  2. SubscriptionRef

WSAck

An ack must be sent on a WebSocket for each event delivered to an application.

Unless autoack is set in the WSStart payload/URL parameters to cause automatic acknowledgement.

Your application should specify the id of each event that it acknowledges.

If the id is omitted, then FireFly will assume the oldest message delivered to the application that has not been acknowledged is the one the ack is associated with.

If multiple subscriptions are started on a WebSocket, then you need to specify the subscription namespace+name as part of each ack.

If you send an acknowledgement that cannot be correlated, then a WSError payload will be sent to the application.

Example

{
    "type": "ack",
    "id": "f78bf82b-1292-4c86-8a08-e53d855f1a64",
    "subscription": {
        "namespace": "ns1",
        "name": "app1_subscription"
    }
}

Field Descriptions

Field Name Description Type
type WSActionBase.type FFEnum:
"start"
"ack"
"protocol_error"
id WSAck.id UUID
subscription WSAck.subscription SubscriptionRef

SubscriptionRef

Field Name Description Type
id The UUID of the subscription UUID
namespace The namespace of the subscription. A subscription will only receive events generated in the namespace of the subscription string
name The name of the subscription. The application specifies this name when it connects, in order to attach to the subscription and receive events that arrived while it was disconnected. If multiple apps connect to the same subscription, events are workload balanced across the connected application instances string