Class BufferedSplittableAsyncRequestBody.Builder
-
Method Summary
Modifier and TypeMethodDescriptionasyncRequestBody(AsyncRequestBody asyncRequestBody) Sets theAsyncRequestBodyto wrap and make retryable.bufferBeforeSend(Boolean bufferBeforeSend) Configures whether to fully buffer each part before sending it downstream.build()Builds a newBufferedSplittableAsyncRequestBodyinstance.
-
Method Details
-
asyncRequestBody
public BufferedSplittableAsyncRequestBody.Builder asyncRequestBody(AsyncRequestBody asyncRequestBody) Sets theAsyncRequestBodyto wrap and make retryable.- Parameters:
asyncRequestBody- the request body to wrap. Must not be null.- Returns:
- this builder for method chaining
-
bufferBeforeSend
Configures whether to fully buffer each part before sending it downstream.When enabled, each part is fully buffered before being sent to the downstream subscriber. This guarantees that the retry buffer is always populated before the HTTP layer subscribes, making per-part retry deterministically successful for slow streaming sources (e.g., SFTP).
When disabled (the default), each part is sent immediately upon initialization in the known-content-length path, allowing the HTTP connection to open while data is still arriving.
Memory usage: Enabling this option does not increase the maximum memory footprint. Buffered data remains bounded by the
bufferSizeInBytesconfigured in theAsyncRequestBodySplitConfiguration. The only behavioral difference is timing: data is held in the buffer slightly longer (until the part is complete) before being sent downstream, rather than being streamed out concurrently.- Parameters:
bufferBeforeSend- whether to enable full buffering before sending parts downstream. Defaults tofalse.- Returns:
- this builder for method chaining
-
build
Builds a newBufferedSplittableAsyncRequestBodyinstance.- Returns:
- a new instance configured by this builder
- Throws:
NullPointerException- if asyncRequestBody is null
-