Class AwsCrtHttpClient
java.lang.Object
software.amazon.awssdk.http.crt.AwsCrtHttpClient
- All Implemented Interfaces:
AutoCloseable
,SdkHttpClient
,SdkAutoCloseable
An implementation of
SdkHttpClient
that uses the AWS Common Runtime (CRT) Http Client to communicate with
Http Web Services. This client has a synchronous interface, but uses non-blocking IO.
This can be created via builder()
SdkHttpClient client = AwsCrtHttpClient.builder()
.maxConcurrency(100)
.connectionTimeout(Duration.ofSeconds(1))
.connectionMaxIdleTime(Duration.ofSeconds(5))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Builder that allows configuration of the AWS CRT HTTP implementation. -
Method Summary
Modifier and TypeMethodDescriptionstatic AwsCrtHttpClient.Builder
builder()
Each HTTP client implementation should return a well-formed client name that allows requests to be identifiable back to the client that made the request.void
close()
static SdkHttpClient
create()
Create aAwsCrtHttpClient
client with the default configurationprepareRequest
(HttpExecuteRequest request) Create aExecutableHttpRequest
that can be used to execute the HTTP request.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
-
Method Details
-
builder
-
create
Create aAwsCrtHttpClient
client with the default configuration- Returns:
- an
SdkHttpClient
-
clientName
Description copied from interface:SdkHttpClient
Each HTTP client implementation should return a well-formed client name that allows requests to be identifiable back to the client that made the request. The client name should include the backing implementation as well as the Sync or Async to identify the transmission type of the request. Client names should only include alphanumeric characters. Examples of well formed client names include, ApacheSync, for requests using Apache's synchronous http client or NettyNioAsync for Netty's asynchronous http client.- Specified by:
clientName
in interfaceSdkHttpClient
- Returns:
- String containing the name of the client
-
prepareRequest
Description copied from interface:SdkHttpClient
Create aExecutableHttpRequest
that can be used to execute the HTTP request.- Specified by:
prepareRequest
in interfaceSdkHttpClient
- Parameters:
request
- Representation of an HTTP request.- Returns:
- Task that can execute an HTTP request and can be aborted.
-
close
public void close()Description copied from interface:SdkAutoCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-