News
AWS Previews Common Runtime HTTP Client for Java SDK
- By John K. Waters
- 09/10/2020
Amazon Web Services (AWS) introduced a new HTTP client for the AWS SDK for Java 2.0 this week.
Released as a preview, the AWS Common Runtime HTTP client (CRT HTTP) is an asynchronous, non-blocking HTTP client built on top of the Java bindings of the AWS Common Runtime.
"You can use the CRT HTTP client to benefit from features such as improved performance, connection health checks, and post-quantum TLS (Transport Layer Security) support," explained AWS software development engineer Zoe Wang in a blog post. Wang provides a detailed explanation of how to use the AWS CRT HTTP client in her post.
First previewed in 2017, the AWS SDK for Java 2.0 was a major rewrite of the 1.11.x code base. It was built on top of Java 8 and added some frequently requested features, including support for non-blocking I/O and the ability to use a different HTTP implementation at runtime.
This is the second first-party asynchronous HTTP client supported by the Java SDK. The first was the Netty HTTP Client.
Among other benefits, the CRT HTTP client reduces the startup-time of the SDK for Java. The client has a faster cold-start time compared with other HTTP clients supported in the SDK, AWS says. In fact, current customers of the NettyNioAsyncHttpClient could see performance improvements of up to 46 percent, Wang said, depending on the application configuration. "In addition to cold-start improvements," she said, "when we compared the CRT HTTP client with NettyNioAsyncClient in our local testing using the Java Microbenchmark Harness (JMH), we've seen throughput improvements up to 17 percent for concurrent API calls, and up to 32 percent for sequential API calls."
The new CRT HTTP client also comes with improved DNS load balancing support. The Java Virtual Machine (JVM) caches DNS name lookups for a specific period of time, known as the time-to-live (TTL).
"Because DNS name entries used by AWS services can occasionally change," Wang explained, "it's important to set the TTL to a smaller value, so that it periodically refreshes its cached IP information. Customers often need to set the TTL value manually via the system property with other existing HTTP clients, and finding out an appropriate value often requires extensive research and testing."
The CRT HTTP client has an asynchronous DNS resolver that polls each requested DNS address at a regular interval, Wang added, so customers don't need to configure the TTL value themselves.
The connection monitoring options in the CRT HTTP client allow users to configure the health checks, and a feature supported in the AWS Key Management Service (AWS KMS) adds new, post-quantum cipher suites when connecting to AWS KMS API endpoints. "Post-quantum TLS provides additional security that protects your TLS traffic from being decrypted by a large-scale quantum computer in the future," Wang said.
The list of limitations in this release is short, but the CRT HTTP client currently supports only the HTTP/1.1 protocol, which means it can't be used with SDK clients that require HTTP/2 support. "While client-side metrics are generally available, specific HTTP metrics for the CRT are not yet implemented," Wang said. "We are planning to implement this feature, which allows you to detect, diagnose issues and monitor the resources in the CRT HTTP Client, in the near future."
About the Author
John K. Waters is the editor in chief of a number of Converge360.com sites, with a focus on high-end development, AI and future tech. He's been writing about cutting-edge technologies and culture of Silicon Valley for more than two decades, and he's written more than a dozen books. He also co-scripted the documentary film Silicon Valley: A 100 Year Renaissance, which aired on PBS. He can be reached at jwaters@converge360.com.