Class HttpClient
java.lang.Object
io.camunda.zeebe.client.impl.http.HttpClient
- All Implemented Interfaces:
AutoCloseable
Thin abstraction layer on top of Apache's HTTP client to wire up the expected Zeebe API
conventions, e.g. errors are always
ProblemDetail
,
content type is always JSON, etc.-
Constructor Summary
ConstructorsConstructorDescriptionHttpClient
(org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient client, com.fasterxml.jackson.databind.ObjectMapper jsonMapper, URI address, org.apache.hc.client5.http.config.RequestConfig defaultRequestConfig, int maxMessageSize, org.apache.hc.core5.util.TimeValue shutdownTimeout, CredentialsProvider credentialsProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
<RespT> void
delete
(String path, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result) <HttpT,
RespT>
voidget
(String path, org.apache.hc.client5.http.config.RequestConfig requestConfig, Class<HttpT> responseType, JsonResponseTransformer<HttpT, RespT> transformer, HttpZeebeFuture<RespT> result) org.apache.hc.client5.http.config.RequestConfig.Builder
Creates a new request configuration builder with the default values.<RespT> void
patch
(String path, String body, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result) <RespT> void
post
(String path, String body, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result) void
start()
-
Constructor Details
-
HttpClient
public HttpClient(org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient client, com.fasterxml.jackson.databind.ObjectMapper jsonMapper, URI address, org.apache.hc.client5.http.config.RequestConfig defaultRequestConfig, int maxMessageSize, org.apache.hc.core5.util.TimeValue shutdownTimeout, CredentialsProvider credentialsProvider)
-
-
Method Details
-
start
public void start() -
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
newRequestConfig
public org.apache.hc.client5.http.config.RequestConfig.Builder newRequestConfig()Creates a new request configuration builder with the default values. The builder can be used to customize the request configuration for a specific request.- Returns:
- a new request configuration builder
-
get
public <HttpT,RespT> void get(String path, org.apache.hc.client5.http.config.RequestConfig requestConfig, Class<HttpT> responseType, JsonResponseTransformer<HttpT, RespT> transformer, HttpZeebeFuture<RespT> result) -
post
public <RespT> void post(String path, String body, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result) -
patch
public <RespT> void patch(String path, String body, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result) -
delete
public <RespT> void delete(String path, org.apache.hc.client5.http.config.RequestConfig requestConfig, HttpZeebeFuture<RespT> result)
-