I am working on an AWS SNS integration in Java using spring-aws library and I have a simple notification mapper like this:
@NotificationMessageMapping
public void handleNotificationMessage(@NotificationSubject String subject,
@NotificationMessage SimplePojo message) throws IOException {
log.info("Received message {}", message);
}
The problem is that it does not work and I get following exception:
Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Error converting notification message with payload:{"name":"simpleName"}
I can change SimplePojo to String and then do the conversion manually and it will work but the question is whether this is possible to avoid manual conversion and have it done like with SqsListeners where spring handles it under the hood.
What is weird is that when I use local-stack then it works.