Skip to content

fix(webhook): deliver data events on a dedicated executor - #72

Merged
hendrikebbers merged 2 commits into
mainfrom
fix/webhook-async-delivery
Nov 24, 2026
Merged

hendrikebbers merged 2 commits into
mainfrom
fix/webhook-async-delivery

Conversation

@hendrikebbers

Copy link
Copy Markdown
Contributor

@Async on WebhookSender.sendAndTrack(WebhookDto, …) never took effect: the method was called through this, bypassing the Spring proxy, and the library does not enable @Async anyway. Every webhook call therefore ran sequentially on the thread that saved the data, so a slow or unreachable receiver blocked save(...) and delete(...) of any data service.

Data events are now handed to a dedicated webhookTaskExecutor (virtual threads, no default candidate, so Spring Boot's applicationTaskExecutor stays in place). A ping still runs on the calling thread.

The call result is written through the new WebhookDataService.recordCall, which only updates status and call time and publishes no lifecycle event. Saving the full DTO would have published an OnObjectUpdate<WebhookDto>, which - now that the write really commits - would trigger a webhook call for every webhook call.

hendrikebbers and others added 2 commits November 24, 2026 21:56
`@Async` on `WebhookSender.sendAndTrack(WebhookDto, …)` never took effect:
the method was called through `this`, bypassing the Spring proxy, and the
library does not enable `@Async` anyway. Every webhook call therefore ran
sequentially on the thread that saved the data, so a slow or unreachable
receiver blocked `save(...)` and `delete(...)` of any data service.

Data events are now handed to a dedicated `webhookTaskExecutor` (virtual
threads, no default candidate, so Spring Boot's `applicationTaskExecutor`
stays in place). A ping still runs on the calling thread.

The call result is written through the new `WebhookDataService.recordCall`,
which only updates status and call time and publishes no lifecycle event.
Saving the full DTO would have published an `OnObjectUpdate<WebhookDto>`,
which - now that the write really commits - would trigger a webhook call
for every webhook call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hendrikebbers
hendrikebbers merged commit e8cb06a into main Nov 24, 2026
1 check passed
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.

1 participant