Migrate from version 1.x to 2.x of the Amazon SDK for Java - Amazon SDK for Java 2.x
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Migrate from version 1.x to 2.x of the Amazon SDK for Java

The Amazon SDK for Java 2.x is a major rewrite of the 1.x code base built on top of Java 8+. It includes many updates, such as improved consistency, ease of use, and strongly enforced immutability. This section describes the major features that are new in version 2.x, and provides guidance on how to migrate your code to version 2.x from 1.x.

What’s new in version 2

  • You can configure your own HTTP clients. See HTTP transport configuration.

  • Async clients feature non-blocking I/O support and return CompletableFuture objects. See Asynchronous programming.

  • Operations that return multiple pages have autopaginated responses. This way, you can focus your code on what to do with the response, without the need to check for and get subsequent pages. See Pagination.

  • SDK start time performance for Amazon Lambda functions is improved. See SDK start time performance improvements.

  • Version 2.x supports a new shorthand method for creating requests.

    dynamoDbClient.putItem(request -> request.tableName(TABLE))

For more details about the new features and to see specific code examples, refer to the other sections of this guide.