Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microservices Communication in .NET Using gRPC

You're reading from   Microservices Communication in .NET Using gRPC A practical guide for .NET developers to build efficient communication mechanism for distributed apps

Arrow left icon
Product type Paperback
Published in Feb 2022
Publisher Packt
ISBN-13 9781803236438
Length 486 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Fiodar Sazanavets Fiodar Sazanavets
Author Profile Icon Fiodar Sazanavets
Fiodar Sazanavets
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Basics of gRPC on .NET
2. Chapter 1: Creating a Basic gRPC Application on ASP.NET Core FREE CHAPTER 3. Chapter 2: When gRPC Is the Best Tool and When It Isn't 4. Chapter 3: Protobuf – the Communication Protocol of gRPC 5. Section 2: Best Practices of Using gRPC
6. Chapter 4: Performance Best Practices for Using gRPC on .NET 7. Chapter 5: Applying Versioning to the gRPC API 8. Chapter 6: Scaling a gRPC Application 9. Section 3: In-Depth Look at gRPC on .NET
10. Chapter 7: Using Different Call Types Supported by gRPC 11. Chapter 8: Using Well-Known Types to Make Protobuf More Handy 12. Chapter 9: Securing gRPC Endpoints in Your ASP.NET Core Application with SSL/TLS 13. Chapter 10: Applying Authentication and Authorization to gRPC Endpoints 14. Chapter 11: Using Logging, Metrics, and Debugging in gRPC on .NET 15. Assessments 16. Other Books You May Enjoy

Questions

Answer the following questions to test your knowledge of this chapter:

  1. Please select the false statement:

    A. In Protobuf, a service is defined by the service keyword, while its methods are defined by the rpc keyword.

    B. You cannot have a Protobuf message definition without any fields.

    C. A Protobuf message can have collections of objects and can use other message definitions as field types.

    D. You have to specify a request object in a response object inside a gRPC method definition and you can only use a single object type in each of those.

  2. Which platforms can you run a .NET implementation of gRPC on?

    A. Windows, Linux, and macOS

    B. Windows and macOS only

    C. Unix-based (macOS and Linux) only

    D. Windows only

  3. How do you enable server-side gRPC components in .NET applications?

    A. So long as you reference the Grpc.AspNetCore NuGet package, it will be automatically enabled for you.

    B. You just need to add a proto file to your project; the compiler will do everything else for you.

    C. You need to define a proto element inside the project file. It can be blank or you can set its GrpcServices attribute to either Server or Both.

    D. You need to define a proto element inside the project file and you must set its GrpcServices attribute to Server.

  4. After adding the relevant proto files to your server-side application project, what modifications do you need to make to your code?

    A. You just need to override the methods from the auto-generated C# code files with your functionality.

    B. You need to modify the auto-generated C# classes and add your functionality to them.

    C. You need to create a new class that inherits from the auto-generated base class, add gRPC to your application services via the ConfigureServices method of the Startup class, and then register the newly created class as one of the endpoints in your middleware.

    D. The system will generate all the required code for you. You just need to fill the methods with your logic.

  5. Can the .NET implementation of the .NET client call RPCs both synchronously and asynchronously?

    A. It can only call methods synchronously.

    B. It can only call methods asynchronously.

    C. There is both a synchronous and asynchronous version of each method that's generated for the client to use.

    D. All auto-generated methods are asynchronous, but you can change the implementation to make them synchronous.

You have been reading a chapter from
Microservices Communication in .NET Using gRPC
Published in: Feb 2022
Publisher: Packt
ISBN-13: 9781803236438
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime