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
Context
I'm doing an upgrade from 2.x to 3.x with also Spring Boot upgrade from 2.X to 3.x)
I have a config where we are publishing Sns messages using SnsTemplate. Sns topic has one subscription to Sqs queue.
In v2 we have a dedicated config for SnsTemaplate migrated to v3 like this
We consume from the Sqs using @SqsListener without any other dedicated config.
Describe the bug
Once the message is delivered to the listener method I face the following Exception:
Caused by: com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class CommandEvent] value failed for JSON property commandId due to missing (therefore NULL) value for creator parameter commandId which is a non-nullable type
at [Source: (String)"{"Type": "Notification", "MessageId": "47ccfd0e-8df6-428d-afac-58df2fd327bf", "TopicArn": "arn:aws:sns:eu-central-1:000000000000:payment-creation-event", "Message": "{\"commandId\":\"0ebf6027-0cb9-45e0-bbe1-e6e4f7734cf9\"}", "Timestamp": "2023-11-23T18:14:34.308Z", "SignatureVersion": "1", "Signature": "EXAMPLEpH+..", "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-0000000000000000000000.pem", "UnsubscribeURL": "http://localhost:4566/?Action=Unsubscribe&Subscript"[truncated 342 chars]; line: 1, column: 842] (through reference chain: io.east2.km.reward_service.shared.PaymentCreationCommandEvent["commandId"])
at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:101) ~[jackson-module-kotlin-2.16.0.jar:2.16.0]
The CommandEvent class looks like this:
sealed class BusinessEvent()
data class CommandEvent(
val commandId: UUID,
) : BusinessEvent()
@tomazfernandes the idea is good, I'll just need small help on how I can connect the created NotificationMessageArgumentResolver properly?
I tried with dedicated SqsListenerContainerFactory with the created message converter connected but it didn't helped as well.
Type: Bug
Component:
SQS
Context
I'm doing an upgrade from 2.x to 3.x with also Spring Boot upgrade from 2.X to 3.x)
I have a config where we are publishing Sns messages using
SnsTemplate
. Sns topic has one subscription to Sqs queue.In v2 we have a dedicated config for SnsTemaplate migrated to v3 like this
We consume from the Sqs using
@SqsListener
without any other dedicated config.Describe the bug
Once the message is delivered to the listener method I face the following Exception:
The CommandEvent class looks like this:
The body in the exception looks like this:
Listener Method signature:
I tried also adding
defaultSqsListenerContainerFactory
, but this didn't helped out:The same code is successfully working on Spring Boot 2 & Spring Cloud Aws Sqs 2
Maybe I missed some additional config in 3.x version.
The text was updated successfully, but these errors were encountered: