您好我正在尝试在我的spring端点代码中获取aws sns消息。我正在使用spring cloud aws。我已使用访问权限和密钥设置配置。然而,该消息在待定订阅中被触发。我的控制器类是:
@Controller
@RequestMapping("/sns/receive")
public class SnsEndpointController1 {
@NotificationMessageMapping
public void receiveNotification(@NotificationMessage String message, @NotificationSubject String subject) {
// ...
}
@NotificationSubscriptionMapping
public void confirmSubscription(NotificationStatus notificationStatus) {
notificationStatus.confirmSubscription();
}
}
我的xml文件是:
<mvc:annotation-driven>
<mvc:argument-resolvers>
<ref bean="notificationResolver" />
</mvc:argument-resolvers>
</mvc:annotation-driven>
<aws-messaging:notification-argument-resolver id="notificationResolver" />
<aws-context:context-credentials>
<aws-context:instance-profile-credentials/>
<aws-context:simple-credentials access-key="....."
secret-key="....."/>
</aws-context:context-credentials>
<aws-context:context-region region="...."/>
</beans>
请让我知道我错过了什么。