powertools-lambda-java icon indicating copy to clipboard operation
powertools-lambda-java copied to clipboard

Enable writing Middleware code for lambda handler

Open ritigupt1 opened this issue 2 years ago • 2 comments

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

ritigupt1 avatar May 23 '23 18:05 ritigupt1

See what/how python is doing: https://docs.powertools.aws.dev/lambda/python/latest/utilities/middleware_factory/

jeromevdl avatar Aug 02 '23 14:08 jeromevdl

De-prioritising due to backlog depth.

scottgerring avatar Oct 09 '23 11:10 scottgerring

We are actively considering adding a Middleware approach now: https://github.com/aws-powertools/powertools-lambda-java/issues/2202.

Feedback there is very welcome.

phipag avatar Oct 27 '25 13:10 phipag

I will mark this issue as closed in favor of the mini-RFC linked above.

phipag avatar Oct 27 '25 13:10 phipag