Skip to content

Do you have plan to support gRPC? #643

Closed

Description

@tungphuong

Hello,

I dont know that do you have any plan to support gRPC besides http?

Thanks,

Activity

  1. TomPallister commented on Sep 28, 2018

    @TomPallister
    Member

    @tungphuong I don't think gRPC is compatible with the idea of an API gateway like Ocelot. Ocelot has no schema whereas gRPC enforces a schema between upstream and downstream services. Also gRPC can use http as a transport so its not really besides :o

  2. added
    question
    on Sep 28, 2018
  3. geffzhang commented on Oct 2, 2018

    @geffzhang
    Contributor
  4. TomPallister commented on Oct 2, 2018

    @TomPallister
    Member

    @geffzhang that is awesome :)

  5. TomPallister commented on Oct 2, 2018

    @TomPallister
    Member

    @tungphuong I would suggest looking at that! I will keep this issue open and reference that project in the Ocelot docs for anyone else looking to use grpc.

  6. added
    feature
    help wanted
    small effort
    and removed
    question
    on Oct 2, 2018
  7. geffzhang commented on Oct 4, 2018

    @geffzhang
    Contributor

    This is an article about grpc gateway https://www.cnblogs.com/kingreatwill/p/9722963.html

  8. tungphuong commented on Oct 17, 2018

    @tungphuong
    Author

    Many thanks

  9. CESARDELATORRE commented on Jun 15, 2019

    @CESARDELATORRE

    @TomPallister - Hey Tom, any plan to support gRPC in Ocelot? - I'm thinking it'd be a great feature to be able to use Ocelot as a gateway (in addition to pure gRPC re-directions).
    Gateway meaning that external communication from Ocelot to client apps could be using HTTP, but from Ocelot to the internal microservices it'd be using gRPC.

    Asking about Ocelot's implementation because the mentioned gateway above hasn't been updated in the last 8 months..

    Thoughts?

  10. thangchung commented on Jul 29, 2019

    @thangchung

    @CESARDELATORRE I agreed with you. Because of .NET Core 3.0 comes a long with gRPC out of the box so that we need to have some way to forward the gRPC Request into the internal microservices. Just like envoy-filter with grpc transcode. Let me know how do you think? @TomPallister

  11. thangchung commented on Aug 10, 2019

    @thangchung

    @TomPallister @CESARDELATORRE @geffzhang Because I have got the same issue that was reported by @tungphuong in my company project so that I have added the filter which can do a transcoder for JSON to gRPC, the code can be found at https://github.com/thangchung/GrpcJsonTranscoder. It will help to add the aggregation layer that config the endpoint of all down stream gRPC services

  12. saitejaprattipati commented on Apr 1, 2020

    @saitejaprattipati

    @thangchung I have same issue so i have followed your approach and implemented exactly but getting error as below
    Status(StatusCode=Internal, Detail="Error starting gRPC call: The SSL connection could not be established

    I have tried to fix it but it seems the certificate is not trusted can you please help me to solve the issue.

    Here goes the service code:

    public class ArticlesService : Greeter.GreeterBase
    {
        private readonly ILogger<articlesService> _logger;
        public articlesService(ILogger<articlesService> logger)
        {
            _logger = logger;
        }
    
        public override Task<HelloReply> AddArticle(HelloRequest request, ServerCallContext context)
        {
            return Task.FromResult(new HelloReply
            {
                Message = "Hello"
            });
        }
    }

    Here goes the proto code:

    syntax = "proto3";
    
    option csharp_namespace = "Author.Core.GrpcShare";
    
    package greet;
    
    // The greeting service definition.
    service Greeter {
      // Sends a greeting
      rpc addArticle (HelloRequest) returns (HelloReply);
    }
    
    // The request message containing the user's name.
    message HelloRequest {
      string name = 1;
    }
    
    // The response message containing the greetings.
    message HelloReply {
      string message = 1;
    }
    

    Can you please tell me did you face any issue similar?

  13. 11 remaining items

  14. gao-artur commented on Jun 29, 2023

    @gao-artur
  15. VenkateshSrini commented on Jun 30, 2023

    @VenkateshSrini

    doing that now. But I feel it is a overload on client. Also, we may need Ocelot to support the same for streaming scenario

  16. gao-artur commented on Jun 30, 2023

    @gao-artur

    I'm not sure I understand your concerns. When Ocelot is used with its own load balancer, grpc client load balancer is an obvious choice. Otherwise, the user should be aware of grpc long-living connections and can use 3rd party solution (we are using LinkerD in k8s, for example).
    Regarding streaming scenario: every stream will be load balanced. If your conserns about load balancing within a single stream, than this doesn't make sense in general scenario and it's not something grpc supports. Once the stream is started it will work against the same server until the stream is finished.

  17. gao-artur commented on Jun 30, 2023

    @gao-artur

    @VenkateshSrini commented on June 10, 2023:

    This only will work for scenario where gRPC request-reply pattern of messaging is used. gRPC Json transcoding will not be available for gRPC Streaming scenario like file upload and download. How do we handle those kind of patterns if we do not have the load balancing

    Oh. You probably talked about this. Starting .NET 7 there is a transcoding support from Microsoft which also supports server streaming.

  18. VenkateshSrini commented on Jul 1, 2023

    @VenkateshSrini

    @gao-artur commented on Jun 30, 2023:

    Oh. You probably talked about this. Starting .NET 7 there is a transcoding support from Microsoft which also supports server streaming.

    Transcoding does not support server side streaming. Only Request reply that is issue why we cannot use Ocelot out of the box

  19. VenkateshSrini commented on Jul 1, 2023

    @VenkateshSrini

    I'm not sure I understand your concerns. When Ocelot is used with its own load balancer, grpc client load balancer is an obvious choice. Otherwise, the user should be aware of grpc long-living connections and can use 3rd party solution (we are using LinkerD in k8s, for example). Regarding streaming scenario: every stream will be load balanced. If your conserns about load balancing within a single stream, than this doesn't make sense in general scenario and it's not something grpc supports. Once the stream is started it will work against the same server until the stream is finished.

    I think I will elaborate a little bit but that is going to be a long post. I'm looking at a scenario where without a http middle layer Ocelot should do the load balancing. Ocelot can itself acts as a client and then do a client load balancing that is one options. Ocelot should also be sensitive as to whether it is going to load balance a streaming request or Request Reply messaging protocol. Doing later is easy former is difficuilt. For that we can even say that we have to follow some pattern in writing gRPC services, Like allowing for Server side reflection so that the Ocelot can understand the proto contract defined by the gRPC server. We could also say that one service can have endpoints that either follow Request Reply or Streaming and not combine both in one service

  20. raman-m commented on Jul 1, 2023

    @raman-m
    Member

    @gao-artur and @VenkateshSrini
    Why are you discussing here a theory with such long list of messages?
    What is outcome of your debates?

    I expect concrete user scenario(s) and real PR(s) to this repo.
    Please, if you have a real solution, you are welcome to create PR.

    It seems I will close this issue soon because I see zero real results of such long discussions.
    Or the discussion will be blocked...


    @gao-artur wrote on June 29, 2023

    Check the gRPC client-side load balancing

    Thanks for the link!
    I believe we must use this MS Learn doc to integrate gRPC into Ocelot: Call gRPC services with the .NET client

  21. raman-m commented on Jul 1, 2023

    @raman-m
    Member

    ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️

    I believe Ocelot team and community should use & go with these official MS Learn docs:

    Ocelot team and community should borrow ideas & get some real coding recipes from these solutions and products:

    ⚠️ The Ocelot community should use these links above ☝️ for future gRPC implementations in Ocelot core!
    Other custom solutions will be ignored but consideration is possible.
    ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️

  22. locked as too heated and limited conversation to collaborators on Jul 1, 2023
  23. raman-m commented on Jul 1, 2023

    @raman-m
    Member

    @tungphuong Hi Phuong Le!
    Are you interested in contribution and/or discussion?

    You are issue reporter, and we must decide what to do with your issue!..
    A soonest reply will be much appreciated!

  24. removed
    question
    needs feedback
    on Jul 7, 2023
  25. unlocked this conversation on Jul 7, 2023
  26. locked and limited conversation to collaborators on Nov 29, 2023
  27. converted this issue into a discussion #1822 on Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MVPfeaturehelp wantedlarge effort

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions