apache / apisix-java-plugin-runner

APISIX Plugin Runner in Java
https://apisix.apache.org/
Apache License 2.0
130 stars 96 forks source link

Extending business exceptions through the java spi mechanism #298

Open trayliang opened 8 months ago

trayliang commented 8 months ago

Please answer these questions before submitting a pull request


Bugfix

why is it so important / why do we need this / what problem it solves. If we are based on plug-ins, there is no way to scale our business based on exceptions The code is so old that it doesn't know how the response body should return, For example:

We authenticate the user through the plug-in, if the user does not have permission, theory The upper system should tell the user that there is no access permission. Normally we can do that in java Throw an exception and wrap the response by catching the exception


New feature or improvement

trayliang commented 8 months ago

thanks cr

trayliang commented 8 months ago

Hi, I just added lisence,.

shreemaan-abhishek commented 7 months ago

Extending business exceptions through the java spi mechanism

image

Please describe your changes in more detail. Abou why is it so important / why do we need this / what problem it solves.

trayliang commented 7 months ago

Extending business exceptions through the java spi mechanism

image

Please describe your changes in more detail. Abou why is it so important / why do we need this / what problem it solves.

If we are based on plug-ins, there is no way to scale our business based on exceptions The code then doesn't know how the response body should return, For example: We authenticate the user through the plug-in, if the user does not have permission, theory The upper system should tell the user that there is no access permission. Normally we can do that in java Throw an exception and wrap the response by catching the exception

monkeyDluffy6017 commented 7 months ago

This pr didn't import any new features, just refactoring, right?

trayliang commented 7 months ago

This pr didn't import any new features, just refactoring, right?

I think this PR provides the ability to extend exceptions through spi, and I think this is also the ability of this plugin to improve

This code logic is not very difficult, maybe I describe the problem, you can look at the implementation of the code, in fact, can solve the business above the exception capture pain points

monkeyDluffy6017 commented 7 months ago

@nic-chen please help to check