POC of a gRPC project in Java using Maven ☕️
This project contains 2 services: one for LOGIN
and one for LOGOUT
.
-
The Login service will return SUCCESS if the
username
is the same as thepassword
(responseCode 200). Otherwise, the Login service will return INVALID PASSWORD (responseCode 400). -
The Logout service will always return LOGOUT SUCCESS (responseCode 200).
On the GrpcServer
directory, run:
mvn clean generate-sources compile install
On the GrpcClient
directory, run:
mvn clean generate-sources compile install
To start the Server:
-
On the
GrpcServer/src/main/java
directory, run themain
method from theGrpcServer.java
class. -
Note: It will run on port
9090
.
To use the Client:
- On another terminal, run the
main
method from theGrpcClient.java
class located in theGrpcClient/src/main/java
directory.
Using a gRPC Client Tool:
- Example: BloomRPC (Note: You'll need to import the user.proto file).