spring-cloud / spring-cloud/spring-cloud-gateway
how to build grpc response while spring-cloud-gateway handle exception
A pull request for this has already been merged.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
This is a duplicate problem, but I can't find the solution.Anybody know?
When the grpc client requests to the gateway, the gateway occur an exception or check header illegal and then needs to return the message about to the grpc client.
So how to build a ExceptionHandler similar to controlleradvice .
in my case, If no additional processing is done, the grpc client will get a protocol-related exception
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing linked pull request #2938 and its discussion, then trace how Spring Cloud Gateway handles exceptions and illegal headers for gRPC client requests. Done means the gateway returns a valid gRPC response containing the error message instead of causing a protocol-related exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, java, spring, spring-boot
- Domain
- api, backend, networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100