This instructs the API to consider the specified ADMessageId acknowledged at the application layer. The library does not send acknowledgements immediately. It stores the state for acknowledged messages internally and acknowledges messages, in bulk, when a threshold or timer is reached.
The exact behavior of Ack() is controlled by flow property MessageAckMode:
When the transport is flow controlled (for example, the application is overwhelming the underlying tcp connection), if it is not possible for the API to block until the congestion is relieved, the call to this method will return SOLCLIENT_WOULD_BLOCK on sessions configured with SendBlocking set to false. The session event callback delegate will receive a subsequent CanSend when the congestion is relieved. On sessions configured with SendBlocking set to true, the call to this method, will block until the congestion is relieved unless this is not possible (due to to the fact that the this method is called from a callback delegate). If it's not possible to block, this method will return SOLCLIENT_FAIL with a subcode of CannotBlockInContext
In practice this occurs very rarely as most applications do not simulteously publish and receive large amounts of data on the same session. On sessions that primarily receive data, sending acknowledgements alone cannot generate enough traffic to overwhelm the tcp connection.
Ack is equivalent to Settle(Int64, MessageOutcome) with message outcome Accepted.
ReturnCode Ack(
long ADMessageId
)
OperationErrorException | Thrown when the start operation fails. |
ObjectDisposedException | Thrown when the flow is already disposed (terminal state). |
FatalErrorException | Thrown when an unrecoverable error occurs. |