Class BufferedSplittableAsyncRequestBody.Builder

java.lang.Object
software.amazon.awssdk.core.async.BufferedSplittableAsyncRequestBody.Builder
Enclosing class:
BufferedSplittableAsyncRequestBody

public static final class BufferedSplittableAsyncRequestBody.Builder extends Object
  • Method Details

    • asyncRequestBody

      public BufferedSplittableAsyncRequestBody.Builder asyncRequestBody(AsyncRequestBody asyncRequestBody)
      Sets the AsyncRequestBody to wrap and make retryable.
      Parameters:
      asyncRequestBody - the request body to wrap. Must not be null.
      Returns:
      this builder for method chaining
    • bufferBeforeSend

      public BufferedSplittableAsyncRequestBody.Builder bufferBeforeSend(Boolean 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 bufferSizeInBytes configured in the AsyncRequestBodySplitConfiguration. 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 to false.
      Returns:
      this builder for method chaining
    • build

      Builds a new BufferedSplittableAsyncRequestBody instance.
      Returns:
      a new instance configured by this builder
      Throws:
      NullPointerException - if asyncRequestBody is null