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 - Albany NY - January 18 2018
Search
sullis
January 18, 2018
Technology
0
340
AWS SDK for Java, version 2.0 - Albany NY - January 18 2018
AWS User Group
Albany NY
January 18, 2018
#java #scala #gilttech #aws #awscloud
sullis
January 18, 2018
Tweet
Share
More Decks by sullis
See All by sullis
Netty Chicago Java User Group 2024-04-17
sullis
0
200
Java 21 - Portland Java User Group 2023-10-24
sullis
0
230
Microbenchmarking with JMH - Portland 2023-03-14
sullis
0
98
Code generation on the Java VM 2022-04-19
sullis
0
81
Mockito 2022-01-25
sullis
0
150
GitHub Actions 2021-12-16
sullis
0
28
Apache Struts and the Equifax data breach 2021-06-03
sullis
0
45
Guardrail State of the Union 2021-04-13
sullis
0
280
Guardrail: State of the Union 2021-03-18
sullis
0
140
Other Decks in Technology
See All in Technology
どうするコスト最適化のトレードオフ
tetsuyaooooo
1
710
Grafana x PagerDuty Better Together
jacopen
1
250
推しは推せるときに推せ! プロダクトにフィードバックしていこう
nakasho
0
460
Amplify 🩷 Bedrock 〜生成AI入門〜
minorun365
PRO
8
400
The AI Revolution Will Not Be Monopolized: Behind the scenes
inesmontani
PRO
1
150
Building a RAG-poweredAI chat appwith Python and VS Code
pamelafox
0
140
地理空間データ可視化・解析・活用ソリューション Pacific Spatial Solutions (PSS)
pacificspatialsolutions
0
330
Google Cloud Next '24でブログを10本書いた方法と勉強会を沸かせた方法
yasumuusan
0
330
自己改善からチームを動かす! 「セルフエンジニアリングマネージャー」のすゝめ
shoota
6
1k
Microsoft Intune 勉強会 第 2 回目
tamaiyutaro
2
370
KubeConにproposalを送りたい人へのアドバイス
sat
PRO
3
270
.NET Profiler in 2024.
kkamegawa
2
930
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
325
20k
The Language of Interfaces
destraynor
151
23k
Become a Pro
speakerdeck
PRO
12
4.6k
How GitHub (no longer) Works
holman
305
140k
Writing Fast Ruby
sferik
622
60k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
19
6.9k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
Documentation Writing (for coders)
carmenintech
61
4k
Web Components: a chance to create the future
zenorocha
306
41k
Design by the Numbers
sachag
274
18k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
Transcript
Sean Sullivan January 18, 2018 AWS User Group Albany NY
AWS SDK for Java version 2.0
Thank you CommerceHub
software engineer 21 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 Albany
saksfifthavenue.com saksoff5th.com lordandtaylor.com gilt.com thebay.com
gilt.com
gilt.com
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
SDK v2 Maven artifacts
https://search.maven.org/
<dependency> <groupId>com.amazonaws<groupId> <artifactId>aws-java-sdk-dynamodb</artifactId> <version>1.11.267</version> </dependency> Maven dependencies SDK v1 <dependency>
<groupId>software.amazon.awssdk<groupId> <artifactId>dynamodb</artifactId> <version>2.0.0-preview7</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.0-preview-7" "org.scala-lang.modules" %% "scala-java8-compat" % "0.8.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
Gilt’s AWS CloudWatch Scala library
“A tiny Scala wrapper around AWS CloudWatch Java client”
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