Skip to content

Commit

Permalink
Fix mistakes in Java patterns readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gvdongen committed Dec 19, 2024
1 parent b88d06b commit ffa2672
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions java/patterns-use-cases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ If the upload takes too long, however, the client asks the upload service to sen

### Demo scenario

Run the upload client with a userId: `./gradlew -PmainClass=my.example.UploadClient run --args="someone21"`
Run the upload client with a userId: `./gradlew -PmainClass=my.example.dataupload.UploadClient run --args="someone21"`

This will submit an upload workflow to the data upload service.
The workflow will run only once per ID, so you need to provide a new ID for each run.
Expand Down Expand Up @@ -396,7 +396,7 @@ A few notes:
like: ` -H 'idempotency-key: my-id-token'`
* The webhook setup with ngrok is not trivial and can easily be wrong. You might end up with
some payments waiting for the webhooks. You can use the CLI to cancel them:
`npx restate inv list` and `npx restate inv cancel <invocation_id>`.
`restate inv list` and `restate inv cancel <invocation_id>`.
* Here is an opportunity for the SAGAs pattern to cancel payments in that case.

## Event Processing: Transactional Handlers with Durable Side Effects and Timers
Expand Down Expand Up @@ -534,14 +534,14 @@ package1:{"timestamp": "2024-10-10 14:00", "location": "Mountain Road 155, Bruss
```shell
curl localhost:8080/PackageTracker/package1/getPackageInfo
```
or via the CLI: `npx restate kv get package-tracker package1`
or via the CLI: `restate kv get PackageTracker package1`
You can see how the state was enriched by the initial RPC event and the subsequent Kafka events:
```
🤖 State:
―――――――――

Service package-tracker
Service PackageTracker
Key package1

KEY VALUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public void resultAsEmail(SharedWorkflowContext ctx, String email) {
}

public static void main(String[] args) {
RestateHttpEndpointBuilder.builder().bind(new DataUploadService()).buildAndListen(9082);
RestateHttpEndpointBuilder.builder().bind(new DataUploadService()).buildAndListen();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public PackageInfo getPackageInfo(SharedObjectContext ctx){
public static void main(String[] args) {
RestateHttpEndpointBuilder.builder()
.bind(new PackageTracker())
.buildAndListen(9081);
.buildAndListen();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void submitAndAwaitTasks(AsyncTaskWorker.TaskOpts taskOpts) {
// submit the task; similar to publishing a message to a queue
// Restate ensures the task is executed exactly once
SendResponse handle =
AsyncTaskServiceClient.fromClient(restateClient)
AsyncTaskWorkerClient.fromClient(restateClient)
// optionally add a delay to execute the task later
.send(/*Duration.ofDays(1)*/)
.runTask(
Expand Down

0 comments on commit ffa2672

Please sign in to comment.