abp icon indicating copy to clipboard operation
abp copied to clipboard

ABP gRPC Integration

Open hikalkan opened this issue 5 years ago • 21 comments

  • [ ] Investigate "how ABP framework can help developers on gRPC API creation".
  • [ ] Implement gRPC endpoints for all the modules.
  • [ ] Add a starting point for the startup templates.

hikalkan avatar Feb 21 '20 15:02 hikalkan

https://github.com/Cysharp/MagicOnion Looks like a good class library.

maliming avatar Feb 22 '20 03:02 maliming

Thanks @maliming it seems a very good library. However it seems a real-time communication system. With this issue, we only want a standard gRPC implementation.

hikalkan avatar Feb 23 '20 19:02 hikalkan

https://github.com/Cysharp/MagicOnion Looks like a good class library.

This library using without .proto files and only use .net apps beetwen. See this issue https://github.com/Cysharp/MagicOnion/issues/159#issuecomment-502506139 I think create shared .proto files project each module. It's helpfull any language implement and communicate each other.

mehmetuken avatar Feb 24 '20 15:02 mehmetuken

https://devblogs.microsoft.com/premier-developer/sharing-grpc-protobuf-contracts-using-a-rest-endpoint/

geffzhang avatar Mar 21 '20 14:03 geffzhang

https://github.com/thangchung/GrpcJsonTranscoder

geffzhang avatar Apr 27 '20 12:04 geffzhang

Interesting:

image

https://docs.microsoft.com/en-us/aspnet/core/grpc/basics

hikalkan avatar May 21 '20 23:05 hikalkan

No meaning to implement it if it is not supported by Azure and IIS. We are planning to implement Blazor UI to server communication via gRPC but this is a huge restriction.

hikalkan avatar May 21 '20 23:05 hikalkan

We are deferring this issue.

We were planning to use the gRPC endpoints with the Blazor UI, so wanted to work on this first. However, I see that gRPC with AspNet Core & Blazor is not so production ready. Here, the reasons:

Warning at https://docs.microsoft.com/en-us/aspnet/core/grpc/basics

image

Warning/Information at https://docs.microsoft.com/en-us/aspnet/core/grpc/browser

image

And some others...

image

So, instead of using gRPC endpoints, we will try to use the existing REST endpoints with the Blazor UI. This will speed up our development for the Blazor UI.

Anyone wants to use gRPC in their applications, want to create gRPC endpoints for their microservices, they can still use it. We've prepared a sample application: https://github.com/abpframework/abp-samples/tree/master/GrpcDemo

hikalkan avatar May 23 '20 15:05 hikalkan

gRPC-Web for .NET now available https://devblogs.microsoft.com/aspnet/grpc-web-for-net-now-available/

geffzhang avatar Jun 16 '20 23:06 geffzhang

@geffzhang that's great! As I can see, it solves most of the problems. We will check it deeply after v3.0.

hikalkan avatar Jun 17 '20 07:06 hikalkan

https://github.com/protobuf-net/protobuf-net.Grpc It is a code-frist base on grpc-dotnet

expcat avatar Aug 22 '20 00:08 expcat

+1

kegumx avatar Oct 13 '20 08:10 kegumx

+1

rafaelgfirmino avatar Feb 16 '21 20:02 rafaelgfirmino

Is there any news?😀

realZhangChi avatar Mar 25 '21 01:03 realZhangChi

Microsoft switched from ocelot to envoy because of the grpc feature.. see here: https://docs.microsoft.com/de-de/dotnet/architecture/microservices/multi-container-microservice-net-applications/implement-api-gateways-with-ocelot Any further plans also to switch to envoy ? or what is on roadmap for grpc ?

barnybadzoo avatar Mar 30 '21 08:03 barnybadzoo

@hikalkan any updates on this topic?

leonkosak avatar May 02 '21 17:05 leonkosak

+1

manishkgupta02 avatar Jun 05 '21 11:06 manishkgupta02

any updates on this topic?

fanslead avatar Oct 12 '21 10:10 fanslead

There is already a gRPC integration demo that you can check. However if you want to use gRPC instead of http within the framework; that'll take some more time.

We've implemented Static Client Proxy generation so that microservice gateways are no longer referencing Http.Api layers of other microservices to locate endpoints. This will allow us using any other gateway (like envoy etc). With this feature enabled, we've also plans for sample microservices communicating with each other using gRPC so that we can check if we need to make improvements in framework for it.

TLDR: It is in our backlog, we are moving slowly but steadily :)

gterdem avatar Oct 12 '21 11:10 gterdem

https://github.com/protobuf-net/protobuf-net.Grpc It is a code-frist base on grpc-dotnet

Looks better.

RainingNight avatar Apr 06 '22 08:04 RainingNight

Hi all,

I've created two articles for ABP & gRPC:

I see that using gRPC in an ABP-based solution is straightforward. Currently, we don't think to implement any specific integration package. However, I've taken a lot of notes while investigating .NET's gRPC integration and preparing these articles. In the future, we will probably make some built-in integrations to make it even easier. Some of my notes:

  • We can provide packages to automatically register services in the server & client side.
  • We can also reduce the boilerplate code while creating channels and consuming services.
  • We may provide some services to create and configure channels in a central place.
  • We can provide client-side proxy generation with also Dapr integration.
  • We may somehow automatically add tenant id, current culture, correlation id, authorization token... to gRPC requests.

However, all these are additional ABP benefits and currently there is no difference of using gRPC in ABP by comparing in with a .NET solution without ABP.

hikalkan avatar Sep 19 '22 05:09 hikalkan