You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
S3EventNotification is no longer correctly deserialized when switching from com.amazonaws:aws-java-sdk-s3 to software.amazon.awssdk:s3-event-notifications.
Because the constructor and fields are no longer annotated with @JsonCreator and @JsonProperty, Jackson is no longer able to map the JSON correctly.
It's easy to work around it by accepting a String instead of a S3EventNotification in the listener and then performing the deserialization by calling S3EventNotification.fromJson but it would be nicer this wouldn't be needed.
@SqsListener("\${sqs.currents.notifications.processed.queueName}")
funlisten(s3EventNotificationJson:String) {
val s3EventNotification =S3EventNotification.fromJson(s3EventNotificationJson)
copyService.copy(s3EventNotification.records.first())
}
One solution could be to provide a custom JSON Deserializer for that case. Wouldn't mind creating a PR.
The text was updated successfully, but these errors were encountered:
helpermethod
changed the title
S3EventNotification Deserialization no longer works with AWS SDK v2 S3 Event Notification
S3EventNotification deserialization no longer works with AWS SDK v2 S3 Event Notification
Nov 20, 2024
I guess I also need to register the argument resolver in AbstractListenerAnnotationBeanPostProcessor?
Furthermore: Would it make sense to include software.amazon.awssdk:s3-event-notifications as a dependency as S3EventNotification already provides methods for converting from/to JSON?
Type: Bug
Component:
SQS
Describe the bug
S3EventNotification is no longer correctly deserialized when switching from
com.amazonaws:aws-java-sdk-s3
tosoftware.amazon.awssdk:s3-event-notifications
.This is due to the following changes: https://aws.amazon.com/de/blogs/developer/the-aws-sdk-for-java-2-17-removes-its-external-dependency-on-jackson/
Because the constructor and fields are no longer annotated with @JsonCreator and @JsonProperty, Jackson is no longer able to map the JSON correctly.
It's easy to work around it by accepting a String instead of a S3EventNotification in the listener and then performing the deserialization by calling
S3EventNotification.fromJson
but it would be nicer this wouldn't be needed.One solution could be to provide a custom JSON Deserializer for that case. Wouldn't mind creating a PR.
The text was updated successfully, but these errors were encountered: