spring-cloud / spring-cloud/spring-cloud-gateway

how to build grpc response while spring-cloud-gateway handle exception

Open
#2,562 14 comments 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #2914 by @Albertoimpl — closed without merging
  • #2938 by @martamedio — merged
bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.