Allows to configure parameters to the
SseSource.- Since:
- 0.12.0
-
Method Summary
Modifier and TypeMethodDescriptionwithAllowRetryDelayOverride(boolean allow) Configures whether the resulting source allows the server to override the delay for retries.withInitialRetryDelayMillis(long initialRetryDelayMillis) Configures the initial retry delay of the resulting source.withPreserveHeadersCase(boolean preserveHeadersCase) Configures whether the initiator request has to preserve the header case or not.withRequestCustomizer(Consumer<HttpRequestBuilder> requestCustomizer) Configures a callback to customize the initiator request builder.withRequestOptions(Consumer<HttpRequestOptionsConfigurer> requestOptions) Configures a callback to customize the initiator request options.withResponse(HttpResponse response) Useful when you already have anHttpResponsewith an SSE stream.withRetry(boolean shouldRetryOnStreamEnd) Configures whether the source will retry when the SSE stream ends.Sets the URL of the server to send the SSE initiator request to.
-
Method Details
-
withResponse
Useful when you already have anHttpResponsewith an SSE stream. The resulting SSE Source won't do automatic retries.- Parameters:
response- a response that has atext/event-streamas payload.- Returns:
- this configurer.
-
withUrl
Sets the URL of the server to send the SSE initiator request to.- Parameters:
url- the server URL.- Returns:
- this configurer.
-
withAllowRetryDelayOverride
Configures whether the resulting source allows the server to override the delay for retries.- Parameters:
allow- whether the source allows the override or not.- Returns:
- this configurer.
-
withInitialRetryDelayMillis
Configures the initial retry delay of the resulting source.- Parameters:
initialRetryDelayMillis- the delay in milliseconds.- Returns:
- this configurer.
-
withRetry
Configures whether the source will retry when the SSE stream ends.- Parameters:
shouldRetryOnStreamEnd- whether retry or not.- Returns:
- this configurer.
-
withRequestCustomizer
Configures a callback to customize the initiator request builder.- Parameters:
requestCustomizer- the callback.- Returns:
- this configurer.
-
withRequestOptions
Configures a callback to customize the initiator request options.- Parameters:
requestOptions- the callback.- Returns:
- this configurer.
-
withPreserveHeadersCase
Configures whether the initiator request has to preserve the header case or not.- Parameters:
preserveHeadersCase- whether the initiator request has to preserve the header case or not.- Returns:
- this configurer.
-