An open API service indexing awesome lists of open source software.

https://github.com/vladimir-dejanovic/grpc-bank-example

This is example used in my talk REST API vs gRPC. Simple example of Bank backend in gRPC with JavaFX notification client
https://github.com/vladimir-dejanovic/grpc-bank-example

grpc grpc-java java javafx

Last synced: 2 months ago
JSON representation

This is example used in my talk REST API vs gRPC. Simple example of Bank backend in gRPC with JavaFX notification client

Awesome Lists containing this project

README

        

# README #

This is example code used in my talk REST API vs gRPC.

This is just show case example to demonstrate gRPC and some of it's functionalities. This code shouldn't be used in real production systems.

### How do I get set up? ###

* Java 1.8 minimum
* Maven or some IDE from which you can build code

After you download the code just build it and make sure it will compile with your setup

```
mvn clean install
```

### How to start it?

This example consists of example gRPC Bank Server which expose multiple services and gRPC clients for calling those services.

To Start Bank server run this command

```
mvn exec:java -Dexec.mainClass=xyz.itshark.play.rpc.grpc.bank.BankServer
```

Notifications Console Client

```
mvn exec:java -Dexec.mainClass=xyz.itshark.play.rpc.grpc.bank.client.NotificationsConsoleClient -Dexec.args="1"
mvn exec:java -Dexec.mainClass=xyz.itshark.play.rpc.grpc.bank.client.NotificationsConsoleClient -Dexec.args="2"
```

Notifications JavaFX client

```
mvn exec:java -Dexec.mainClass=xyz.itshark.play.rpc.grpc.bank.client.NotificationsJavaFXClient
```

Transfer money from account 1 to account 2

```
mvn exec:java -Dexec.mainClass=xyz.itshark.play.rpc.grpc.bank.client.TransferClient
```

To request transfer run this command

```
mvn exec:java -Dexec.mainClass=xyz.itshark.play.rpc.grpc.bank.client.RequestClient
```