News

Preview Release of AWS CRT HTTP Client for Java SDK Now Available

Amazon Web Services (AWS) announced this week the preview release of a new HTTP client supported in the AWS SDK for Java 2.0. 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.

The CRT HTTP client is the second first-party asynchronous HTTP client supported by the SDK for Java after the Netty NIO HTTP client, explained AWS software development engineer Zoe Wang in a blog post. "You can use the CRT HTTP client to benefit from features such as improved performance, connection health checks, and post-quantum TLS support," she said. Wang provides a detailed explanation on how to use the CRT HTTP client in her post.

This release deals with one of the most common feature requests--better startup-time performance of the SDK for Java. This version of the CRT HTTP client has faster cold-start time compared with other HTTP clients supported in the SDK, Wang said. Current customers of the NettyNioAsyncHttpClient could see performance improvements of up to 46 percent, 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.

This release 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, she added, so customers don't need to configure the TTL value themselves.

The list of improvements in this release includes HTTP connection monitoring options designed to allow users to configure health checks; and a feature supported in AWS Key Management Service (AWS KMS) that adds new, post-quantum cipher suites when connecting to AWS KMS API endpoints. "Post-quantum TLS provides additional security protections 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 the 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."

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.

 

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 [email protected].


Upcoming Events