Skip to content

Commit 0aa456a

Browse files
authored
Merge pull request #314 from nats-io/jnm/37-ack-reply
ADR-37: consumer ack response
2 parents 56f8a13 + 660ae65 commit 0aa456a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

adr/ADR-37.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,20 @@ was described in previous sections.
358358
8. Subtract the values from pending messages count and pending bytes count respectively.
359359
9. Go to #1.
360360

361+
##### Acknowledging
362+
363+
Clients can use the synchronous Ack operation to explicitly ack individual messages and know what the result of the acknowledgement was (i.e. a success or not). The server replies to synchronous positive ack requests ('AckAck') with a standard JS ApiResponse message with a single `success` boolean flag.
364+
365+
```go
366+
type JSApiConsumerAckResponse struct {
367+
ApiResponse
368+
Success bool `json:"success,omitempty"`
369+
}
370+
```
371+
Note: Current (2.10) versions send back a message in response to an AckAck request with an empty payload, regardless of the message having already been acked or not, or of the sequence number being out of range, and do not send any message back if the sequence number is out of range.
372+
373+
If the message being acked is pending an acknowledgement (i.e. already delivered, not yet acked) then success is true in the reply, otherwise (already acked, not yet delivered or out of range) it is omitted (false) and an error is set in the ApiResponse.
374+
361375
#### Info
362376

363377
An optional operation that returns the consumer info. Note that depending on the

0 commit comments

Comments
 (0)