public final class HttpBuilder extends Object
AsyncBuilder
that makes it easier
to wrap Http web service calls as async actions.
The client still has to provide an HttpSpec.asyncHttpFunction
implementation using the Http client of their choice.Constructor and Description |
---|
HttpBuilder() |
Modifier and Type | Method and Description |
---|---|
static <A,D,K,O,R> |
apply(HttpSpec<A,D,K,O,R> spec) |
static <A,D,K,O,R> |
apply(HttpSpec<A,D,K,O,R> spec,
ScheduledExecutorService executor) |
static <A,D,K,O,R> |
apply(HttpSpec<A,D,K,O,R> spec,
TopicConfigBuilder.BuildSteps topicBuildFn) |
static <A,K,B,O,R> |
apply(HttpSpec<A,K,B,O,R> httpSpec,
TopicConfigBuilder.BuildSteps topicBuildFn,
ScheduledExecutorService executor)
A static function that delegates the
AsyncBuilder to provide an implementation of an
action processor that can process http web service calls asynchronously as part of a saga. |
public static <A,K,B,O,R> ActionProcessorBuildStep<A> apply(HttpSpec<A,K,B,O,R> httpSpec, TopicConfigBuilder.BuildSteps topicBuildFn, ScheduledExecutorService executor)
AsyncBuilder
to provide an implementation of an
action processor that can process http web service calls asynchronously as part of a saga.A
- common representation type for all action commands (typically Json / GenericRecord for Avro)K
- key for the output topic for the result of Http topicsB
- body for Http requestO
- value returned by the Http request - also normally quite genericR
- final result type that ends up in value topichttpSpec
- the http spectopicBuildFn
- the topic build fnexecutor
- the executor service that is used to invoke asynchronously and schedule timeoutspublic static <A,D,K,O,R> ActionProcessorBuildStep<A> apply(HttpSpec<A,D,K,O,R> spec, TopicConfigBuilder.BuildSteps topicBuildFn)
public static <A,D,K,O,R> ActionProcessorBuildStep<A> apply(HttpSpec<A,D,K,O,R> spec)
public static <A,D,K,O,R> ActionProcessorBuildStep<A> apply(HttpSpec<A,D,K,O,R> spec, ScheduledExecutorService executor)
Copyright © 2019. All rights reserved.