spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.52k stars 3.32k forks source link

how to use JsonToGrpc GatewayFilter #3398

Closed Bert-long closed 4 months ago

Bert-long commented 5 months ago

Describe the bug Please provide details of the problem, including the version of Spring Cloud that you are using. gateway 4.1.3 springcloud 2023.0.1 Sample fllow the docs https://docs.spring.io/spring-cloud-gateway/reference/spring-cloud-gateway/gatewayfilter-factories/jsontogrpc-factory.html I didn't succeed according to this tutorial, is there a detailed tutorial?

nduyhai commented 5 months ago

Hi @Bert-long ,

I found an example, plz take a look link

Bert-long commented 5 months ago

Hi @Bert-long ,

I found an example, plz take a look link

Thank you very much.

RohanKumarMainali commented 4 months ago

Hi @Bert-long and @nduyhai , are you guys able to use spring cloud gateway to expose REST api and predicate to grpc service?. I am not able to do that following this repo . My main problem is it is using Custom Filter which requires a lot of custom code. Is there a better way?

RohanKumarMainali commented 4 months ago

@nduyhai , I found your repo extremely helpful. It's exactly what I was looking for. It ran with some tweak in classpath for me. Thank you

Bert-long commented 4 months ago

Hi @Bert-long and @nduyhai , are you guys able to use spring cloud gateway to expose REST api and predicate to grpc service?. I am not able to do that following this repo . My main problem is it is using Custom Filter which requires a lot of custom code. Is there a better way?

@RohanKumarMainali if you not must use SpringCloudGateway, you can try gRPC-gateway or apache shenyu.