Skip to content

oel/akka-grpc-iot-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Akka gRPC for IoT Streams

This is a gRPC based application in Scala demonstrating how IoT device states get algorithmically updated as streaming requests/responses using Akka gRPC, which is built on top of Akka Streams and Akka HTTP with HTTP/2 transport.

Akka gRPC generates:

  1. service interfaces from a Protobuf service schema that get implemented as Scala classes and Akka stream components on top of a Akka-HTTP server that supports HTTP/2
  2. gRPC stubs through implementing the service interfaces with Akka Streams API for the gRPC clients to invoke the remote services

For an overview of the application, please visit Genuine Blog.

Running the gRPC server and clients on multiple JVMs

To run the server application, open a command line terminal, go to the project-root and and run as follows:

On terminal #1

sbt "runMain akkagrpc.IotStreamServer"

For the client application, IotStreamClient takes the following parameters:

IotStreamClient clientId broadcastYN propIdStart propIdEnd
# e.g. IotStreamClient client1 1 1000 1049  # broadcastYN: 1=Yes | 0=No

To run the client application, open a terminal for each client, go to the project-root and run a specific range of IDs of real estate properties:

On terminal #2

sbt "runMain akkagrpc.IotStreamClient client1 1 1000 1019"

On terminal #3

sbt "runMain akkagrpc.IotStreamClient client2 1 1020 1039"

About

IoT streaming with Akka gRPC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages