4

現在、Spring 4.1.4 を使用して STS 3.6.3SR1 を使用しています。アプリケーション内での使用の実現可能性について spring-cloud-aws をテストしようとしています。

質問に関連する瓶:

spring-cloud-aws-autoconfigure-1.0.0.RC2.jar

spring-cloud-aws-context-1.0.0.RC2.jar

spring-cloud-aws-core-1.0.0.RC2.jar

spring-cloud-aws-messaging-1.0.0.RC2.jar

aws-sdk-1.9.3 の使用

現在、これは私のxmlコンテキストファイルにあります。

<mvc:annotation-driven>
    <mvc:argument-resolvers>
        <ref bean="notificationResolver"/>
    </mvc:argument-resolvers>
</mvc:annotation-driven> 

<aws-messaging:notification-argument-resolver id="notificationResolver" />


<aws-messaging:notification-messaging-template id="notificationMessagingTemplate" default-destination="snsChannelTopic"/> 

現在、この Controller クラスをエンドポイントとして定義しています。

public class AmazonSNSController {
    @Autowired
    HttpServletRequest request;

    @Autowired
    HttpServletResponse response;

    @NotificationSubscriptionMapping
    public void handleSubscriptionMessage(SnsHelper status) throws IOException {
        //We subscribe to start receive the message
        status.setRequest(request);
        status.setResponse(response);
        status.confirmSubscription();
    }

    @NotificationMessageMapping
    public void handleNotificationMessage(@NotificationSubject String subject, @NotificationMessage String message) {
        System.out.println(subject + message);
    }

    @NotificationUnsubscribeConfirmationMapping
    public void handleUnsubscribeMessage(SnsHelper status) {
        //e.g. the client has been unsubscribed and we want to "re-subscribe"
        //status.confirmSubscription();
    }

上記のクラスでは、SnsHelper がNotificationStatusを実装しており、サブスクリプションが適切に確認されています。handleNotificationMessage メソッドへの通知も受信しています。ただし、送信内容に関係なく、両方の文字列が null と評価されます。

これは、notificationResolverが正しく登録/適用されていないことに関係していると思います。

誰でもこれに関するガイダンスを提供できますか?

ご協力ありがとうございました。

4

0 に答える 0