Skip to content

Acknowledgement(ACK)

After successfully processing messages, consumers have the option to send an acknowledgement, thereby guaranteeing message integrity and preventing loss. Trimble Event Service maintains a record of unacknowledged messages and retransmits them for reprocessing as needed.

Consumer Failure Retry Policy

If the explicit acknowledgement is enabled by the consumer, the Trimble Event Service will await an ACK after delivering a message. In the absence of an ACK, the data is resent. In cases where the server does not receive acknowledgement from the consumer within the configured wait time, the application will consistently receive the same event. The default waiting time is 30 seconds, but it can be adjusted to up to 1 hour. During subsequent polling, unacknowledged messages are retried for up to seven days.

Consumer Acknowledgement Options and Failure Detection

Every consumed message is wrapped inside a batch. Every batch can have one or more messages. The number of messages in the batch is based on the max poll record configuration provided during onboarding. There is a unique batchAckId for every batch and ackId for every message.

Consumers can choose to acknowledge at batch level or message level. A client may not send an ACK continuously for all messages due to consumer-side implementation issues. When this occurs, the messages are reprocessed (retained-redelivered-retained) for seven days.

How it works

Consumers must send an acknowledgement within the configured time limit (default is 30 seconds) for their consumed messages. Consumers can choose to configure the time for sending acknowledgement, default value is 30 seconds, minimum is 5 seconds, and maximum is 1 hour.

Event Service allows a maximum of 500 unacknowledged messages. When the threshold of delivered but unacknowledged messages is reached, the Event Service stops delivering new messages, and consumers poll only stale unacknowledged messages until they acknowledge already delivered messages.

For example:

  • Unacknowledged - 10: The consumer can poll 490 new messages and 10 unacknowledged messages.
  • Unacknowledged - 500: The consumer can poll 500 unacknowledged messages. However, won’t be able to see any new messages until ACK is sent for the unacknowledged delivered messages.

Recommendations

  • If the consumer has enabled an explicit acknowledgement, the consumer should acknowledge a message within the configured time limit.
  • Websocket client should not block the reader thread, preventing the messages from queuing on the server side. Keep the reader thread process light, or do an async process to free up the reader thread.