java – Spring aws-cloud SNS http终点确认订阅无效

在我的春季启动aws-cloud SNS http终点确认订阅无效.当我的应用程序出现错误后SNS确认.

错误:

[Request processing failed; nested exception is java.lang.IllegalArgumentException: Invoked method public abstract void org.springframework.cloud.aws.messaging.endpoint.NotificationStatus.confirmSubscription() is no accessor method!] with root cause
    java.lang.IllegalArgumentException: Invoked method public abstract void org.springframework.cloud.aws.messaging.endpoint.NotificationStatus.confirmSubscription() is no accessor method!
        at org.springframework.util.Assert.notNull(Assert.java:115) ~[spring-core-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
        at org.spring

我的控制器处理器是:

     @NotificationSubscriptionMapping
        public void handleSubscriptionMessage( NotificationStatus status)   throws IOException {
            //Confirming SNS subscription
            status.confirmSubscription();
        }

我的Pom包含以下内容:

     <dependency>
          <groupId>org.springframework.cloud</groupId>
          <artifactId>spring-cloud-aws-messaging</artifactId>
          <version>1.0.4.RELEASE</version>
        </dependency>

        <!-- For Spring AWS autoconfiguration-->
        <dependency>
          <groupId>org.springframework.cloud</groupId>
          <artifactId>spring-cloud-aws-autoconfigure</artifactId>
          <version>1.0.4.RELEASE</version>
        </dependency>

我按照link的说明进行了操作

最佳答案 您是否指定了自定义解析程序:

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

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

另外,我看不到控制器映射,但在教程中有一个声明:

Currently it is not possible to define the mapping URL on the method
level therefore the RequestMapping must be done at type level and must
contain the full path of the endpoint.

点赞