In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "how to connect the Fizz Gateway gateway to the gRPC". In the daily operation, I believe that many people have doubts about how to connect the Fizz Gateway gateway to the gRPC. The editor consulted all kinds of materials and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubts about "how to connect the Fizz Gateway gateway to the gRPC"! Next, please follow the editor to study!
# prerequisites
Fizz Gateway v1.5.0 or above (installation tutorial (opens new window))
GRPC service
The API used later in this document is findById, which echoes the ID and name fields of the input parameters. The JSON is as follows:
{"name": "call findById", "id": "input parameter ID"} # Service and interface maintenance
GRPC service instances and interfaces are centrally maintained to facilitate multiple invocations in the service orchestration. Because the gateway invokes the gRPC interface through generalization, the gRPC service itself needs to enable reflection. Please refer to the example:
Server = ServerBuilder.forPort (port) .addService (new UserService ()) .addService (new ShoppingCartService ()) / / enable gRPC reflection .addService (ProtoReflectionService.newInstance ()) .build ()
Go to the Fizz management backend, open RPC Management-> Service Management, and click add to enter information such as service name and instance. Multiple instances are separated by commas, and the gateway will poll for calls.
Open RPC Management-> Interface Management, and click add to input the interfaces you need into the system. The interfaces that are not used can not be entered.
Configure the output of the service orchestration interface:
# Test
Go back to the interface of the service orchestration and click Test. Enter the Query parameter id=666. The service orchestration API transparently transmits the findById data of the gRPC service, and the following results are obtained:
Open the list to be reviewed and review the list in the previous step:
Publish API:
At this point, the study on "how to connect the Fizz Gateway gateway to the gRPC" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.