Spring Cloud for Amazon Web Services

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”));

Quick start
Bootstrap your application with Spring Initializr.

发布了0 篇原创文章 · 获赞 0 · 访问量 1078

猜你喜欢

转载自blog.csdn.net/blog_programb/article/details/104653848
今日推荐