Skip to content

feat: Let callers hand over the HTTP client, and give up connecting after 10 seconds by default. - #8

Merged
goloroden merged 4 commits into
mainfrom
configure-http-client
Oct 8, 2026
Merged

goloroden merged 4 commits into
mainfrom
configure-http-client

Conversation

@goloroden

Copy link
Copy Markdown
Member

The client created an HTTP client of its own that nobody could configure: no timeout for connecting, no proxy, no TLS. An unreachable server, e.g. behind a firewall that drops packets, left a request waiting for the timeout of the operating system.

What changes:

  • new Client(baseUrl, apiToken, options) takes ClientOptions, a record with with methods like the options for reading and observing. withHttpClient hands over a java.net.http.HttpClient configured by the caller.
  • The client does not close an HTTP client it was given, since it belongs to the caller.
  • The HTTP client the client creates otherwise gives up connecting after 10 seconds.
  • There is deliberately no timeout for whole requests, since it would end every stream that observes events.
  • The README describes how to configure the HTTP client.

Part of the series on the API before the first release. Builds on #7.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hc2MPSLu7HDHTm8HiBsrDz

goloroden and others added 3 commits October 7, 2026 23:42
… as Java package.

Wherever a registry requires a namespace, the client SDKs and the image
of EventSourcingDB use thenativeweb: Packagist, Go modules, Docker Hub.
Maven requires one, so the artifacts are now io.thenativeweb:eventsourcingdb
and io.thenativeweb:eventsourcingdb-testcontainers. The Java packages
follow the group ID, as is the convention in Java, and are now
io.thenativeweb.eventsourcingdb and its testcontainers subpackage.

Nothing has been published yet, so no caller is affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hc2MPSLu7HDHTm8HiBsrDz
…NullAway.

Java can not say whether a value may be null. Both packages are now
@NullMarked, so everything is non-null unless it is marked @nullable,
as the optional fields of EventCandidate and of the options are.
Kotlin reads these annotations, and Spring Boot 4 uses them, too.

NullAway checks the code against the annotations as part of the build,
and runs as the only check of Error Prone. Making LineStream pass it
made explicit that it reads only once it has opened its stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hc2MPSLu7HDHTm8HiBsrDz
…fter 10 seconds by default.

The client created an HTTP client of its own that nobody could
configure, without a timeout for connecting, a proxy, or TLS. An
unreachable server left a request waiting for the timeout of the
operating system.

A Client now takes ClientOptions, whose HTTP client it sends requests
with if one is given. It does not close that HTTP client, since it
belongs to the caller. The HTTP client it creates otherwise gives up
connecting after 10 seconds. There is deliberately no timeout for whole
requests, since it would end every stream that observes events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hc2MPSLu7HDHTm8HiBsrDz
@goloroden
goloroden requested a review from a team as a code owner October 8, 2026 05:08
@goloroden goloroden self-assigned this Oct 8, 2026
Base automatically changed from annotate-nullability to main October 8, 2026 06:41
main holds the squashed #6 and #7, whose content this branch already
contains, so the merge keeps the content of this branch as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hc2MPSLu7HDHTm8HiBsrDz
@goloroden
goloroden merged commit 3f31ea9 into main Oct 8, 2026
2 checks passed
@goloroden
goloroden deleted the configure-http-client branch October 8, 2026 06:54
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