I am currently using STS 3.6.3SR1 using Spring 4.1.4. Trying to test spring-cloud-aws for feasibility of use within our application.
Jars Related to Question :
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
Using aws-sdk-1.9.3
Currently have this in my xml context file.
<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"/>
Currently have this Controller class defined as my endpoint.
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();
}
In the above class SnsHelper implements NotificationStatus and I have confirmed the subscription properly. I am receiving notifications to the handleNotificationMessage method as well. However, both Strings evaluate to null regardless of what I send.
I believe this has to do with the notificationResolver not being registered/applied correctly.
Can anyone provide some guidance on this?
Thank you for your help.
Aucun commentaire:
Enregistrer un commentaire