Spring Cloud Gateway Custom Exception Handling

992 Views Asked by At

I'm currently running Spring Cloud Gateway version 2.2.5.RELEASE. I'm still fairly new to this project - so forgive me if this is something fairly simple. I've not found a good solution to my issue and feel like I'm starting to spin my wheels a bit.

My current application is correctly forwarding requests to the desired down stream server(s). However, we occasionally get Connection issues from them. As such, I'd like to trap those errors and perform some type of audit messaging (notificaions, etc), then return the original error back to the client. Is there a good mechanism where I can plug-in my notification logic when these error occur? Can someone point me towards an example of registering this handler, or overriding the existing functionality. Again, I still want the exception passed back to the client - just want to inspect the error and kick off a seperate process for audit purposes.

Thanks for any insight!

Cheers!

0

There are 0 best solutions below