10.27.03

IFlowAck Method

Sends an acknowledgement for a message received over this flow.

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:

  • AutoAck - Messages are acknowledged automatically by the API and calling this function has no effect.
  • ClientAck - Every message received must be acknowledged by the application through individual calls to Ack().

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.


Definition

Namespace: SolaceSystems.Solclient.Messaging
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.27.0
C#
ReturnCode Ack(
	long ADMessageId
)

Parameters

ADMessageId  Int64
ADMessageId of the message to acknowledge.

Return Value

ReturnCode
When successful, it returns SOLCLIENT_OK.

Exceptions

OperationErrorException Thrown when the start operation fails.
ObjectDisposedException Thrown when the flow is already disposed (terminal state).
FatalErrorException Thrown when an unrecoverable error occurs.

See Also