hanishi commented on issue #1458:
URL:
https://github.com/apache/pekko-connectors/issues/1458#issuecomment-3995056538
## Related: No automatic lease management (ack deadline extension)
The same gap exists for lease management. The official Google client
libraries
automatically extend ack deadlines for messages being processed (via
periodic
`modifyAckDeadline` calls). pekko-connectors does not.
### Impact
If a handler takes longer than `streamAckDeadlineSeconds`, Pub/Sub
force-redelivers
the message. The original ackId expires, making subsequent ack/nack calls
no-ops.
This causes:
1. **Uncontrolled duplicate processing** on success
2. **Loss of retry control** on failure (nack delay is bypassed)
### Workaround
Periodic `modifyAckDeadline` calls via Pekko scheduler, canceling on
handler completion:
```scala
val extender = system.scheduler.scheduleAtFixedRate(30.seconds,
30.seconds) { () =>
subscriberClient.modifyAckDeadline(
ModifyAckDeadlineRequest(subscription, Seq(ackId), ackDeadlineSeconds
= 60)
)
}
// On handler complete: extender.cancel() then ack/nack
This is something the connector could handle internally, similar to
reconnection.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]