SpringOne 2021
Session Title: Spring Boot on Amazon Web Services with Spring Cloud AWS
Speakers: Maciej Walkowiak, Software Consultant at Independent; Matej Nedic, Software engineer at Ingemark
8. @maciejwalkowiak @matejnedic1
SPRING CLOUD AWS
•Created by Agim Emruli and Alain Shall
•First commit in February 2011
•Community project
•April 2020 - not a part of Spring
Cloud release train
•May 2020 - new maintainers
59. @maciejwalkowiak @matejnedic1
@Component
public class SnsNotificationSender {
private final NotificationMessagingTemplate
notificationMessagingTemplate;
public SnsNotificationSender(
NotificationMessagingTemplate notificationMessagingTemplate)
{
this.notificationMessagingTemplate =
notificationMessagingTemplate;
}
public void send(String subject, String message) {
this.notificationMessagingTemplate.sendNotification(
"physicalTopicName", message, subject);
}
}
60. @maciejwalkowiak @matejnedic1
@Controller
@RequestMapping("/springone-topic")
public class NotificationController {
@NotificationSubscriptionMapping
public void handleSubscriptionMessage(NotificationStatus status) {
//We subscribe to start receive the message
status.confirmSubscription();
}
@NotificationMessageMapping
public void handleNotificationMessage(@NotificationSubject String subject,
@NotificationMessage String message) {
// ...
}
@NotificationUnsubscribeConfirmationMapping
public void handleUnsubscribeMessage(NotificationStatus status) {
//e.g. the client has been unsubscribed and we want to "re-subscribe"
status.confirmSubscription();
}
}
79. @maciejwalkowiak @matejnedic1
Parameter Store
• Type: Supports
StringList,String,
SecureString.
• 4KB char max
• Can’t be referenced cross
account
• Can’t rotate secrets
• Cheaper
Secret manager
• Can be referenced cross
account
• Automatic Secret rotation
• More expensive
• Can store more characters 10kb
• Built in password generator
• Supports secret cross region
replication
83. @maciejwalkowiak @matejnedic1
WHEN SPRING CLOUD AWS IS NOT ENOUGH
•Spring Cloud Stream Kinesis Binder
https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis
•Spring Integration AWS
https://github.com/spring-projects/spring-integration-aws
•Spring Cloud Config Server
https://github.com/spring-cloud/spring-cloud-config
•Spring Data DynamoDB
https://github.com/boostchicken/spring-data-dynamodb
85. @maciejwalkowiak @matejnedic1
•AWS SDK v2
•$ GraalVM Native Image compatible
•$ Non Blocking - Spring WebFlux friendly!
•$ Pluggable HTTP client
•$ Does not conflict with SDK v1
•% Still no feature parity with 1.x
WHEN SPRING CLOUD AWS IS NOT ENOUGH
100. @maciejwalkowiak @matejnedic1
•Migrate from AWS SDK v1 to AWS SDK v2
•CloudMap integration (PR ready)
•Spring Data Dynamo DB (?)
•Drop support for: ElastiCache, CloudFormation
•Improve startup times
•GraalVM Native Image compatibility
FUTURE SPRING CLOUD AWS 3.X