gRPC - Real-World .NET Core/.NET 5 Applications

preview_player
Показать описание
gRPC is a high performance Remote Procedure Call framework that can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking and authentication.

In this video, we talk about how to combine regular ASP.NET Core Web API endpoints with gRPC. How to design and implement your applications insofar as gRPC code generated classes and how to deal with and handle exceptions.

Introduction to gRPC

gRPC - Getting Started .NET 5/ .NET Core 3.x

The Source code of the project built during this video is available here:

The Original (non-gRPC version) MovieService application that is more fleshed out and include tons of Tests can be found here:

Chapter Markers
00:00 Intro
00:47 Introduction to the "System"
02:58 Roles and Responsibilities of the gRPC Stubs/Service Interface Layer
06:00 Role of the gRPC Code generated files
09:18 Introducing the MovieServiceGrpc class (gRPC Abstraction)
10:11 Adding gRPC to an ASP.NET Core application
11:05 The .proto Files
12:38 Implementation of the MovieServiceGrpc class
21:35 gRPC Client side Gateway
23:04 Implementation of the Client side Gateway
27:55 Implementing the Client (using the Gateway)
31:29 Implementing the gRPC Streaming method
31:48 Slowing down the Streaming
34:46 Handling RpcExceptions
40:44 Getting the Business Exception to be thrown
48:45 Conclusion
Рекомендации по теме
Комментарии
Автор

Thank you Shiv. I noticed you have enabled ads now. I make sure every time to watch the advertisement completely, however lengthy it might be, to thank you for all your hard work. I know its nothing for the work you do, but its a small token of thanks from me 🙏😊

VinuP
Автор

Again quality content. I really apricate you taking time in explaining why you need to do certain thing instead of Just showing how it's done. it does provide a prospective. On other topic I was going through the ASP.net core documentation and stumble upon 'Route to code' and could not wrap my head around why would we need something like that ? May be once you have some time you can have an explainer video about that.

chanakyakumar
Автор

Nice video series Shiv. If I may add some constructive criticism, please show the code on the screen for longer, right now you pan the video between the code and yourself and I'm having to rewind and pause a lot just to get a better look at the code. So I suggest either keep the video showing the code only or if you want to show yourself to explain a concept then bring it up within a small picture-in-picture format so we can see both the code and yourself.
Thanks for your tutorial series!

cheesypufs
Автор

Great video shiv! I have really enjoyed listening and learning from this, I may be mistaken but there is no tutorial/documentation on how to use gRPC outside of localhost.
If you have any reference to where I could find that information, I would greatly appreciate that! (specifically talking on connection via IPv4 address)

xStepBrother
Автор

Great content Shiv, thank you for taking the time to share your experience with us! I was wondering if you would share your thoughts on using gRPC Interceptors to house the code that translates exceptions instead of using mapping methods inside the Gateway classes. Just because this is technically possible, I'm struggling with the idea of doing it that way. Using interceptors feels like I'm hiding away valuable knowledge of my system.

stephendavidson
Автор

Great video Shiv, wanted to know if gRPC will be suitable if you want to implement a communication component for broadcasting messages to multiple clients ?
Thank you once again for your amazing well curated content 😊

ClintonVincen
Автор

There is a security aspect of communicating exception details over the wire. You really have to make sure you're not exposing any internals that can be misused/abused.
I would also filter out any exceptions that are not domain based (you have domain exception base-classes you can catch on) and package them into a generic technical 'call your admin' exception without any details (your Internal status code?).
Also throwing an Exception (not a specialized derived type) in the client is not the best IMO.

obiwanjacobi