Search⌘ K
AI Features

Configuring the gRPC Server

Understand how to configure a gRPC server by setting up a Java Maven module with necessary dependencies and build plugins. Learn how to organize project structure, manage resources, and create an executable server artifact for handling client requests.

Creating a gRPC server

Creating a gRPC server is a two-step process:

  1. We will override the FTP service base class generated from the service definition to do the actual "work" of our service.

  2. We will run a gRPC server to listen for client requests and return service responses using the logic implemented in the service class in the previous step.

As of now, the course project (created earlier) has one module named ftp-service-proto. Now we will add another module for the server implementation.

If you wish to follow along on your local machine, open the grpc-ftp-project in your IDE and create a "Module" named ftp-service with the following properties:

  • Choose "Java" as "Language."

  • Choose "Maven" as the "Build system."

  • We have used io.datajek as the "GroupId."

  • We have used ftp-service as the "ArtifactId."

This module will automatically be added to the POM file of the grpc-ftp-project as can be seen below: ...