This project is a distributed system using gRPC for communication. It interacts with various services, including an Echo service, Joke service, Library service, Encryption/Decryption service, and Trivia service. The client communicates with these services using Protocol Buffers and gRPC. The system also features a registry that keeps track of available services.
- gRPC Communication: Implemented a gRPC client-server architecture. Utilized gRPC for efficient and reliable communication between different services.
- Utilized Protocol Buffers for message serialization.
- Service Registry: Implemented a service registry for service discovery. Implemented a service registry to dynamically register and discover available services.
- Encryption Service: Created an encryption service featuring a Caesar cipher for both encryption and decryption.
- Library Management Service: Developed a library management service allowing users to check out and return books.
- Trivia Game Service: Implemented a trivia game service with random questions and answers.
- Added the project to amazon s3 instance.
gradle runNode
gradle Client
gradle runRegistryServer -PgrpcPort=<grpcPort>
gradle runRegistryServer -PgrpcPort=<grpcPort>
gradle runClient -PserviceHost=<serviceHost> -PservicePort=<servicePort> -PregistryHost=<registryHost> -PgrpcPort=<grpcPort> -PregOn=<regOn>
gradle runClient2 -PserviceHost=<serviceHost> -PservicePort=<servicePort> -PregistryHost=<registryHost> -PgrpcPort=<grpcPort> -Pmessage=<message> -PregOn=true
To encrypt a string, you need to make a gRPC call to the encrypt method.
-
Request Message: EncryptRequest: Contains the string (input) to be encrypted. Response Message:
-
EncryptResponse: Indicates whether the operation was successful (isSuccess), provides the encrypted string (solution), and an error message (error) if applicable.
To decrypt a string, you need to make a gRPC call to the decrypt method.
-
Request Message: DecryptRequest: Contains the string (input) to be decrypted. Response Message:
-
DecryptResponse: Indicates whether the operation was successful (isSuccess), provides the decrypted string (solution), and an error message (error) if applicable.
To check out a book, a client needs to make a gRPC call to the checkout method.
- LibraryReq: Contains the client's name (name) and the book to be checked out (book).
- LibraryRes: Indicates whether the checkout was successful (isSuccess), and an error message (error) if applicable.
To return a book, a client needs to make a gRPC call to the returnBook method.
LibraryReq: Contains the client's name (name) and the book to be returned (book).
LibraryRes: Indicates whether the return was successful (isSuccess), and an error message (error) if applicable.
To return a book, a client needs to make a gRPC call to the returnBook method.
google.protobuf.Empty: No additional information is required.
AvailableRes: Contains a list of available books (books).
To get a random trivia question, a client needs to make a gRPC call to the getTriviaQuestion method.
- TriviaRequest: Contains the category (category) of the trivia question.
- TriviaResponse: Contains the trivia question (question) and a list of possible options (options).
To submit an answer to a trivia question, a client needs to make a gRPC call to the submitTriviaAnswer method.
TriviaAnswerRequest: Contains the submitted answer (answer).
TriviaAnswerResponse: Indicates whether the answer was correct (isCorrect), and provides an explanation (explanation).
Shifts characters using a Caesar cipher.
Reverses the encryption process.
Allows users to check out books from the library.
Enables users to return books to the library.
Lists available books in the library.
Retrieves a random trivia question based on the specified category.
Allows users to submit an answer and provides feedback on correctness.