Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AWS SDK for Java version 2.0 - Portland Oregon
Search
sullis
August 28, 2018
Technology
0
320
AWS SDK for Java version 2.0 - Portland Oregon
Portland Java User Group
Portland Oregon
August 28, 2018
sullis
August 28, 2018
Tweet
Share
More Decks by sullis
See All by sullis
Amazon S3 - Portland Java User Group 2024-09-17
sullis
0
53
Netty - Montreal Java User Group 2024-05-21
sullis
0
130
Netty Chicago Java User Group 2024-04-17
sullis
0
800
Java 21 - Portland Java User Group 2023-10-24
sullis
0
280
Microbenchmarking with JMH - Portland 2023-03-14
sullis
0
130
Code generation on the Java VM 2022-04-19
sullis
0
110
Mockito 2022-01-25
sullis
0
170
GitHub Actions 2021-12-16
sullis
0
35
Apache Struts and the Equifax data breach 2021-06-03
sullis
0
54
Other Decks in Technology
See All in Technology
The Rise of LLMOps
asei
5
1.2k
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
350
TypeScript、上達の瞬間
sadnessojisan
46
13k
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
150
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
120
Amazon Personalizeのレコメンドシステム構築、実際何するの?〜大体10分で具体的なイメージをつかむ〜
kniino
1
100
AGIについてChatGPTに聞いてみた
blueb
0
130
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
460
CysharpのOSS群から見るModern C#の現在地
neuecc
1
3.1k
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
What's new in Ruby 2.0
geeforr
343
31k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Designing Experiences People Love
moore
138
23k
YesSQL, Process and Tooling at Scale
rocio
169
14k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Embracing the Ebb and Flow
colly
84
4.5k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Transcript
Sean Sullivan August 28, 2018 Portland Java User Group AWS
SDK for Java version 2.0
software engineer 22 years on the JVM Portland Oregon back
office systems Hudson’s Bay Company About me
Agenda Hudson’s Bay Company SDK for Java • version 1.x
• version 2.x Scala and AWS
https://en.wikipedia.org/wiki/Hudson%27s_Bay_Company
Toronto NYC
saksfifthavenue.com saksoff5th.com lordandtaylor.com thebay.com
saksfifthavenue.com
walmart.com
HBC Tech stack
Web Checkout Android Checkout iPhone Checkout Checkout service
AWS SDK for Java
SDK v2 announced June 2017 @awsforjava
“Under the hood, we use an HTTP client built on
top of Netty to make the non- blocking HTTP call” “first class support for non-blocking I/O in our async clients” source: AWS Developer Blog
import java.util.concurrent.CompletableFuture; DynamoDBAsyncClient client = DynamoDBAsyncClient.builder() .region(Region.US_WEST_2) .build(); CompletableFuture<ListTablesResponse> response
= client.listTables(ListTablesRequest.builder().build()); CompletableFuture<List<String>> tableNames = response.thenApply(ListTablesResponse::tableNames); tableNames.whenComplete((tables, err) -> { if (tables != null) { tables.forEach(System.out::println); } else { err.printStackTrace(); } }); SDK v2
Github projects aws-sdk-java aws-sdk-java-v2
SDK v2 Developer Preview
Pull Request
$ cd aws-sdk-java-v2 $ git log | grep 'Author: Sean
Sullivan' | wc -l 39
SDK v2 Maven artifacts
https://search.maven.org/
<dependency> <groupId>com.amazonaws<groupId> <artifactId>aws-java-sdk-dynamodb</artifactId> <version>1.11.397</version> </dependency> Maven dependencies SDK v1 <dependency>
<groupId>software.amazon.awssdk<groupId> <artifactId>dynamodb</artifactId> <version>2.0.1</version> </dependency> SDK v2
import com.amazonaws.services.cloudwatch.AmazonCloudWatchClient; import com.amazonaws.services.cloudwatch.AmazonCloudWatchClientBuilder; import com.amazonaws.services.cloudwatch.model.MetricDatum; import com.amazonaws.services.cloudwatch.model.PutMetricDataRequest; Java packages
SDK v1 import software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClient; import software.amazon.awssdk.services.cloudwatch.model.MetricDatum; import software.amazon.awssdk.services.cloudwatch.model.PutMetricDataRequest; SDK v2
distinct Maven artifact names distinct Java package names SDK v2
and SDK v1 can co-exist in a Java application SDK v1 jar SDK v2 jar
SDK v2 programming API • Immutable clients and models •
Enhanced pagination • Smart configuration merging • Forward-compatible enums • Streaming operations as first-class concepts
AWS SDK v2 in a Scala application?
val awsSdkVersion = “2.0.1" "org.scala-lang.modules" %% "scala-java8-compat" % “0.9.0", "software.amazon.awssdk"
% "cloudwatch" % awsSdkVersion, "software.amazon.awssdk" % "dynamodb" % awsSdkVersion build.sbt
import scala.compat.java8.FutureConverters._ import scala.collection.JavaConverters._ Foo.scala
FutureConverters?
java.util.concurrent.CompletableFuture scala.concurrent.Future
FutureConverters.scala
gfc-aws-cloudwatch
“A tiny Scala wrapper around AWS CloudWatch Java client” gfc-aws-cloudwatch
https://github.com/gilt/gfc-aws-cloudwatch
how to migrate gfc-aws-cloudwatch from SDK v1 to SDK v2
?
https://github.com/ gilt/gfc-aws- cloudwatch/pull/8/ files
Conclusion SDK v1 — production ready SDK v2 — coming
soon github.com/aws twitter.com/awsforjava
The end
None
Bonus material
“Developing Applications on AWS in the JVM” AWS re:Invent 2017
https://www.slideshare.net/AmazonWebServices/ dev205developing-applications-on-aws-in-the-jvm