diff --git a/java/food-ordering/README.md b/java/food-ordering/README.md index 545985c1..bff99915 100644 --- a/java/food-ordering/README.md +++ b/java/food-ordering/README.md @@ -20,6 +20,12 @@ WebUI is running at http://localhost:3000 Jaeger is running at http://localhost:16686 +When you are making changes to the code, and you want to trigger a build of the Docker images: + +```shell +docker compose build --no-cache +``` + Clean up after bringing setup down: ```shell docker compose rm diff --git a/java/food-ordering/app/restate-app/src/main/java/dev/restate/sdk/examples/DriverDigitalTwin.java b/java/food-ordering/app/restate-app/src/main/java/dev/restate/sdk/examples/DriverDigitalTwin.java index c041e98c..318686fc 100644 --- a/java/food-ordering/app/restate-app/src/main/java/dev/restate/sdk/examples/DriverDigitalTwin.java +++ b/java/food-ordering/app/restate-app/src/main/java/dev/restate/sdk/examples/DriverDigitalTwin.java @@ -18,8 +18,8 @@ /** * Digital twin for the driver. Represents a driver and his status, assigned delivery, and location. - * Keyed by driver ID. The actual driver would have an application (mocked by DriverSimService) that - * calls this service. + * Keyed by driver ID. The actual driver would have an application (mocked by DriverMobileAppSimulator + * ) that calls this service. */ public class DriverDigitalTwin extends DriverDigitalTwinRestate.DriverDigitalTwinRestateImplBase { @@ -36,7 +36,7 @@ public class DriverDigitalTwin extends DriverDigitalTwinRestate.DriverDigitalTwi StateKey.of("driver-location", JacksonSerdes.of(Location.class)); /** - * When the driver starts his work day or finishes a delivery, his application (DriverSimService) + * When the driver starts his work day or finishes a delivery, his application (DriverMobileAppSimulator) * calls this method. */ @Override @@ -55,7 +55,7 @@ public void setDriverAvailable(RestateContext ctx, OrderProto.DriverAvailableNot } /** - * Gets called by the delivery service when this driver was assigned to do the delivery. Updates + * Gets called by the delivery manager when this driver was assigned to do the delivery. Updates * the status of the digital driver twin, and notifies the delivery service of its current * location. */ @@ -106,13 +106,15 @@ public void notifyDeliveryPickup(RestateContext ctx, OrderProto.DriverId request currentDelivery.notifyPickup(); ctx.set(ASSIGNED_DELIVERY, currentDelivery); - // Update the status of the delivery in the delivery service + // Update the status of the delivery in the delivery manager DeliveryManagerRestate.newClient(ctx) .oneWay() .notifyDeliveryPickup(toOrderIdProto(currentDelivery.orderId)); } - /** */ + /** + * Gets called by the driver's mobile app when he has delivered the order to the customer. + */ @Override public void notifyDeliveryDelivered(RestateContext ctx, OrderProto.DriverId request) throws TerminalException { diff --git a/java/food-ordering/app/restate-app/src/main/java/dev/restate/sdk/examples/external/DriverMobileAppSimulator.java b/java/food-ordering/app/restate-app/src/main/java/dev/restate/sdk/examples/external/DriverMobileAppSimulator.java index 698750cb..4b5d312b 100644 --- a/java/food-ordering/app/restate-app/src/main/java/dev/restate/sdk/examples/external/DriverMobileAppSimulator.java +++ b/java/food-ordering/app/restate-app/src/main/java/dev/restate/sdk/examples/external/DriverMobileAppSimulator.java @@ -21,7 +21,7 @@ * This would actually be a mobile app that drivers use to accept delivery requests, and to set * themselves as available. * - *
For simplicity, we implemented this with Restate.
+ * For simplicity, we implemented this with Restate.
*/
public class DriverMobileAppSimulator
extends DriverMobileAppSimulatorRestate.DriverMobileAppSimulatorRestateImplBase {
@@ -34,12 +34,14 @@ public class DriverMobileAppSimulator
private final long PAUSE_BETWEEN_DELIVERIES = 2000;
StateKey