Skip to content

Keep poll acknowledgements in a store and support long polling - #24

Merged
thomasdarimont merged 3 commits into
mainfrom
gh-23-long-poll-ack
Oct 5, 2026
Merged

thomasdarimont merged 3 commits into
mainfrom
gh-23-long-poll-ack

Conversation

@thomasdarimont

Copy link
Copy Markdown
Collaborator

An SsfPollAckStore holds what the poller owes the transmitter until a request carried it, in memory by default or in the new EASYSSF_POLL_ACK table, so a SET handled before a restart is acknowledged afterwards instead of delivered again; stop() flushes. setLongPolling(hold) keeps one request outstanding (RFC 8936, section 2.5), with a timeout per request and a polling thread instead of the scheduler; the Spring Boot starter picks the poll client in SsfTransmitterFactory.pollHttpClient. The in-memory stores lock with ReentrantLock, which does not pin virtual threads. Result limits go through the JDBC driver, and the stores are tested on MySQL as well as H2 and PostgreSQL. SsfPoller.setThreadFactory lets a framework create the polling thread

Closes #23

An SsfPollAckStore holds what the poller owes the transmitter until a
request carried it, in memory by default or in the new EASYSSF_POLL_ACK
table, so a SET handled before a restart is acknowledged afterwards
instead of delivered again; stop() flushes. setLongPolling(hold) keeps
one request outstanding (RFC 8936, section 2.5), with a timeout per
request and a polling thread instead of the scheduler; the Spring Boot
starter picks the poll client in SsfTransmitterFactory.pollHttpClient.
The in-memory stores lock with ReentrantLock, which does not pin
virtual threads. Result limits go through the JDBC driver, and the
stores are tested on MySQL as well as H2 and PostgreSQL.
SsfPoller.setThreadFactory lets a framework create the polling thread

Closes #23

Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
Two pollers on one TestTransmitter stream with a shared dedup and
acknowledgement store, on H2, PostgreSQL and MySQL: a SET is handled
once, and the acknowledgement or error report one instance could not
deliver leaves with the next poll of the other.

Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
easyssf.receiver.poll.pending-acks, tagged with the transmitter,
registered when a poller starts through the new
SsfReceiverMetrics.pollerStarted; the health details already showed the count.

Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
@thomasdarimont
thomasdarimont merged commit cf7c243 into main Oct 5, 2026
10 checks passed
@thomasdarimont
thomasdarimont deleted the gh-23-long-poll-ack branch October 5, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add long polling and a durable acknowledgement store for POLL delivery

1 participant