-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: scala cloud service side of things, first iteration
- Loading branch information
1 parent
9cddb36
commit 04e87ec
Showing
9 changed files
with
398 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...rant-drone-deliveries-service-scala/src/main/protobuf/charging/charging_station_api.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
syntax = "proto3"; | ||
|
||
option java_multiple_files = true; | ||
option java_package = "charging.proto"; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
|
||
package charging; | ||
|
||
service ChargingStationService { | ||
rpc CreateChargingStation(CreateChargingStationRequest) returns (CreateChargingStationResponse) {} | ||
rpc GetChargingStationState(GetChargingStationStateRequest) returns (GetChargingStationStateResponse) {} | ||
} | ||
|
||
message CreateChargingStationRequest { | ||
// unique identifier for the charging station | ||
string charging_station_id = 1; | ||
// location of the station | ||
string location_id = 2; | ||
// number of parallel charging slots for drones | ||
uint32 charging_slots = 3; | ||
} | ||
|
||
message CreateChargingStationResponse { | ||
} | ||
|
||
message GetChargingStationStateRequest { | ||
string charging_station_id = 1; | ||
} | ||
|
||
message GetChargingStationStateResponse { | ||
// location of the station | ||
string location_id = 1; | ||
// number of parallel charging slots for drones | ||
uint32 charging_slots = 2; | ||
// drones currently at the station charging | ||
repeated ChargingDrone currently_charging_drones = 3; | ||
} | ||
|
||
message ChargingDrone { | ||
string drone_id = 1; | ||
// timestamp when charging is estimated to complete | ||
google.protobuf.Timestamp charging_complete = 2; | ||
} |
1 change: 1 addition & 0 deletions
1
samples/grpc/restaurant-drone-deliveries-service-scala/src/main/resources/application.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
include "cluster" | ||
include "grpc" | ||
include "persistence" | ||
include "replication" | ||
|
||
akka { | ||
loglevel = DEBUG | ||
|
14 changes: 14 additions & 0 deletions
14
samples/grpc/restaurant-drone-deliveries-service-scala/src/main/resources/replication.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Allow replication of the charging station entities between the cloud service and the edge systems | ||
akka.projection.grpc.replication.accept-edge-replication = on | ||
|
||
# Replication configuration for the ShoppingCart. Note that config `charging-station` | ||
# is the same as the ChargingStation.EntityType. | ||
|
||
charging-station { | ||
self-replica-id = cloud1 | ||
self-replica-id = ${?SELF_REPLICA_ID} | ||
entity-event-replication-timeout = 10s | ||
parallel-updates = 8 | ||
# all other replicas are edge replicas and not known up front | ||
replicas: [ ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.