Spring Cloud for Amazon Web Services 2.2.2

乜安志
2023-12-01

Spring Cloud for Amazon Web Services, part of the Spring Cloud umbrella project, eases the integration with hosted Amazon Web Services. It offers a convenient way to interact with AWS provided services using well-known Spring idioms and APIs, such as the messaging or caching API. Developers can build their application around the hosted services without having to care about infrastructure or maintenance.
Features

Spring Messaging API implementation for [SQS](http://aws.amazon.com/sqs/).

Spring Cache API implementation for [ElastiCache](http://aws.amazon.com/elasticache/).

Annotation-based mapping of [SNS](http://aws.amazon.com/sns/) endpoints (HTTP).

Access the resources by their logical name defined in a [CloudFormation](http://aws.amazon.com/cloudformation/) stack.

Automatic JDBC DataSource creation based on the logical name of an [RDS](http://aws.amazon.com/rds/) instance.

Ant-style path matching ResourceLoader for [S3](http://aws.amazon.com/s3/) buckets.

Annotation-based SQS Queue Listener

@MessageMapping(“logicalQueueName”)
private void receiveMessage(Person person, @Header(“SenderId”) String senderId) {
// …
}

Annotation-based SNS Listener

@Controller
@RequestMapping("/sns/receive")
public class SnsEndpointController {

@NotificationMessageMapping
public void receiveNotification(@NotificationMessage String message, @NotificationSubject String subject) {
// …
}

@NotificationSubscriptionMapping
public void confirmSubscription(NotificationStatus notificationStatus) {
notificationStatus.confirmSubscription();
}

Messaging Templates

snsTemplate.sendNotification(“SnsTopic”, “message”, “subject”);
sqsTemplate.convertAndSend(“Queue”, new Person(“John”, “Doe”));

Spring Initializr
Quickstart Your Project
Bootstrap your application with Spring Initializr.

 类似资料:

相关阅读

相关文章

相关问答