Enable writing Middleware code for lambda handler
Is your feature request related to a problem? Please describe.
I was working on adding retry and error/exception handling to the lambda written in Java when I came across an AWS reinvent talk where best practices to handle the errors was told. There was a mention of writing Middleware code to centralise the error/exception handling and for some runtimes like Python and Node.js AWS Lambda powertools already provide a way to do this using annotations. For Java, we are missing this feature in Powertools. Describe the solution you'd like
Powertools to enable writing a middleware code which can be called before and/or after lambda function handler invocation. Describe alternatives you've considered
Additional context
See what/how python is doing: https://docs.powertools.aws.dev/lambda/python/latest/utilities/middleware_factory/
De-prioritising due to backlog depth.
We are actively considering adding a Middleware approach now: https://github.com/aws-powertools/powertools-lambda-java/issues/2202.
Feedback there is very welcome.
I will mark this issue as closed in favor of the mini-RFC linked above.