flush command
Sends a command to AMPS that returns an acknowledgment when all previous commands from this client have been processed. This command helps applications that use AMPS determine when AMPS has received all of the messages that have been sent, making it safe for the client to exit.
Notice that the publishFlush command available in the AMPS client libraries includes additional logic (when a PublishStore is present) to ensure that messages published to AMPS have been safely persisted.
Header Fields
The following table contains the header fields available to a flush command.
| Field | Description |
|---|---|
cmd | The command to be executed. Value: |
client_name | A string identifier used to give a client a unique ID. |
ack_type | Acknowledgment type for the given command. Value is a comma separated list of one or more of the following: |
Returns
A flush message specifying an AckType of completed or processed will receive an ack message when all previous messages from this client have been processed by AMPS.
The following table contains the acknowledgment messages that can be returned by a flush command.
| Acknowledgment | Description |
|---|---|
none | No This is the default behavior. |
completed | All previous commands have been processed by AMPS. |
persisted | All previous commands from this publisher have been persisted by AMPS (or have failed and produced the requested acknowledgments). |
processed | AMPS has processed the flush message. |
received | The flush command has been received. |
stats | Not supported at this time. |