-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-lambda-events: Using TracingSqsMessageHandler
or TracingSqsEventHandler
result in ClassCastException
#7362
Comments
Hi @tylerbenson, I think you are specifying handler method name in the handler definition like
But as you mentioned, because of type erasure in the However, when no method name is specified, input and output types are resolved from class/interface generic type parameters by following the parent classes/interfaces.
So when you specify your handler definition as I think, as this is the default and only (no customization is allowed) behavior of AWS Lambda Java RIC, this behavior might be documented without any change in the SDK, WDYT? |
Hi @tylerbenson @cleverchuk, any thoughts on this? |
@serkan-ozal this sounds reasonable. I haven't had this come up again for me recently and I haven't had time to investigate further, so I'll go ahead and close this with the assumption that your workaround will solve the problem. Thanks. |
When trying to create a handler that extends one of these classes, the
handleRequest
method inTracingRequestHandler
is erased to a genericObject
type. At runtime, Lambda inspects the type signature of this method and falls back toLinkedHashMap
if a proper event type is not defined. This is passed into the lambda, but later results in the following exception:TracingRequestHandler
should not use a generic type.What version are you using?
Environment
Corretto 11 Lambda Runtime.
The text was updated successfully, but these errors were encountered: