Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly adhere to Flow spec when converting flows #556

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

mtdowling
Copy link
Member

To map the JavaHttpClient's Flow.Publisher<List> to our Flow.Publisher we have to buffer byte buffers until downstream subscribers request them. We were previously just calling onNext with each individual ByteBuffer for as many buffers as we were handed by the client's publisher.

In addition to now queueing these byte buffers when necessary, this commit also adds a dedicated DataStream for the JavaHttpClientTransport to avoid a bunch of intermediate conversions we were doing previously to convert the publisher to a ByteBuffer or to an InputStream.

I added some basic test cases and also tested manually calling some services, which is how I discovered we needed to update system properties for the client statically too.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mtdowling mtdowling force-pushed the flow-publisher-httpclient branch from 42aa0a6 to 026d1bd Compare January 10, 2025 22:23
To map the JavaHttpClient's Flow.Publisher<List<ByteBuffer>> to our
Flow.Publisher<ByteBuffer> we have to buffer byte buffers until
downstream subscribers request them. We were previously just calling
onNext with each individual ByteBuffer for as many buffers as we were
handed by the client's publisher.

In addition to now queueing these byte buffers when necessary, this
commit also adds a dedicated DataStream for the JavaHttpClientTransport
to avoid a bunch of intermediate conversions we were doing previously to
convert the publisher to a ByteBuffer or to an InputStream.

I added some basic test cases and also tested manually calling some
services, which is how I discovered we needed to update system
properties for the client statically too.
@mtdowling mtdowling force-pushed the flow-publisher-httpclient branch from 026d1bd to 34995db Compare February 4, 2025 19:45
@mtdowling mtdowling merged commit 32ed4be into main Feb 4, 2025
3 checks passed
@mtdowling mtdowling deleted the flow-publisher-httpclient branch February 5, 2025 22:01
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.

2 participants