Spring系列学习之Spring Cloud 亚马逊Web服务AWS

英文原文:Spring Cloud for Amazon Web Services

目录

概述

特性

基于注解的SQS队列侦听器

基于注解的SNS监听器

 消息模板

快速开始

学习

文档

示例


概述

Spring Cloud for Amazon Web Services是Spring Cloud项目的一部分,可以简化与托管Amazon Web Services的集成。它提供了一种使用众所周知的Spring习语和API(如消息传递或缓存API)与AWS提供的服务进行交互的便捷方式。开发人员可以围绕托管服务构建应用程序,而无需关心基础结构或维护。

特性


基于注解的SQS队列侦听器



@MessageMapping("logicalQueueName")
private void receiveMessage(Person person, @Header("SenderId") String senderId) {
    // ...
}

基于注解的SNS监听器



@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();
}

 消息模板



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

快速开始

使用Spring Initializr引导您的应用程序。

学习

文档

每个Spring项目都有自己的; 它详细解释了如何使用项目功能以及使用它们可以实现的功能。

2.1.0 RC1 PRE CURRENTReference Doc. API Doc. 
2.0.2 SNAPSHOT CURRENTReference Doc. API Doc. 
2.0.1 CURRENT GAReference Doc. API Doc. 
1.2.4 SNAPSHOT CURRENTReference Doc. API Doc. 
1.2.3 CURRENT GAReference Doc. API Doc. 
1.1.4 GAReference Doc. API Doc. 
1.0.4 GAReference Doc. API Doc. 

示例

尝试一些例子:

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值