Skip to content

Commit 7874d23

Browse files
siri-varmacicoyle
andauthored
Apply suggestions from code review
Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]>
1 parent cc03ea4 commit 7874d23

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

daprdocs/content/en/java-sdk-docs/java-jobs/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ type: docs
33
title: "Jobs"
44
linkTitle: "Jobs"
55
weight: 3000
6-
description: With the Dapr Job package, you can interact with the Dapr Job APIs from a Java application to trigger future operations to run according to a predefined schedule with an optional payload. To get started, walk through the [Dapr Jobs]({{< ref java-jobs-howto.md >}}) how-to guide.
6+
description: With the Dapr Jobs package, you can interact with the Dapr Jobs APIs from a Java application to trigger future operations to run according to a predefined schedule with an optional payload. To get started, walk through the [Dapr Jobs]({{< ref java-jobs-howto.md >}}) how-to guide.
77
---

daprdocs/content/en/java-sdk-docs/java-jobs/java-jobs-howto.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ description: How to get up and running with Jobs using the Dapr Java SDK
77
---
88

99
As part of this demonstration we will schedule a Dapr Job. The scheduled job will trigger an endpoint registered in the
10-
same app. With the [provided jobs example](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/jobs), you will:
10+
same app. With the [provided jobs example](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/jobs), you will:
1111

1212
- Schedule a Job [Job scheduling example](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/jobs/DemoJobsClient.java)
13-
- Register an endpoint for the Jobs runtime to invoke as part of the schedule [Endpoint Registration](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/jobs/DemoJobsSpringApplication.java)
13+
- Register an endpoint for the dapr sidecar to invoke at trigger time [Endpoint Registration](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/jobs/DemoJobsSpringApplication.java)
1414

1515
This example uses the default configuration from `dapr init` in [self-hosted mode](https://github.com/dapr/cli#install-dapr-on-your-local-machine-self-hosted).
1616

@@ -25,43 +25,43 @@ This example uses the default configuration from `dapr init` in [self-hosted mod
2525

2626
## Set up the environment
2727

28-
Clone the [Java SDK repo](https://github.com/dapr/java-sdk) and navigate into it.
28+
Clone the [Java SDK repo](https://github.com/dapr/java-sdk) and navigate into it.
2929

3030
```bash
3131
git clone https://github.com/dapr/java-sdk.git
3232
cd java-sdk
3333
```
3434

35-
Run the following command to install the requirements for running this jobs sample with the Dapr Java SDK.
35+
Run the following command to install the requirements for running the jobs example with the Dapr Java SDK.
3636

3737
```bash
3838
mvn clean install -DskipTests
3939
```
4040

41-
From the Java SDK root directory, navigate to the Dapr Workflow example.
41+
From the Java SDK root directory, navigate to the Dapr Jobs example.
4242

4343
```bash
4444
cd examples
4545
```
4646

47-
We'll run a command that starts the Dapr sidecar.
47+
Run the Dapr sidecar.
4848

4949
```sh
5050
dapr run --app-id jobsapp --dapr-grpc-port 51439 --dapr-http-port 3500 --app-port 8080
5151
```
5252

5353
> Now, Dapr is listening for HTTP requests at `http://localhost:3500` and internal Jobs gRPC requests at `http://localhost:51439`.
5454
55-
## Register a job and Get its details
55+
## Schedule and Get a job
5656

57-
In the `DemoJobsClient` there are steps to Register a Job. Calling the `scheduleJob` on the `DaprPreviewClient`
57+
In the `DemoJobsClient` there are steps to schedule a job. Calling `scheduleJob` using the `DaprPreviewClient`
5858
will schedule a job with the Dapr Runtime.
5959

6060
```java
6161
public class DemoJobsClient {
6262

6363
/**
64-
* The main method of this app to register and fetch jobs.
64+
* The main method of this app to schedule and get jobs.
6565
*/
6666
public static void main(String[] args) throws Exception {
6767
try (DaprPreviewClient client = new DaprClientBuilder().withPropertyOverrides(overrides).buildPreviewClient()) {
@@ -78,12 +78,12 @@ public class DemoJobsClient {
7878
}
7979
```
8080

81-
and calling a getJob retrieves the created job details
81+
Call `getJob` to retrieve the job details that were previously created and scheduled.
8282
```
8383
client.getJob(new GetJobRequest("dapr-job-1")).block()
8484
```
8585

86-
Command to run the `DemoJobsClient`
86+
Run the `DemoJobsClient` with the following command.
8787

8888
```sh
8989
java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.jobs.DemoJobsClient
@@ -125,10 +125,10 @@ public class JobsController {
125125

126126
Parameters:
127127

128-
* `jobName`: The name of the job that triggered the callback.
128+
* `jobName`: The name of the triggered job.
129129
* `payload`: Optional payload data associated with the job (as a byte array).
130130

131-
Command to run the Spring boot app:
131+
Run the Spring Boot application with the following command.
132132

133133
```sh
134134
java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.jobs.DemoJobsSpringApplication
@@ -146,12 +146,12 @@ Job Payload: Hello World!
146146
public class DemoJobsClient {
147147

148148
/**
149-
* The main method of this app to register and fetch jobs.
149+
* The main method of this app deletes a job that was previously scheduled.
150150
*/
151151
public static void main(String[] args) throws Exception {
152152
try (DaprPreviewClient client = new DaprClientBuilder().buildPreviewClient()) {
153153

154-
// Get a job.
154+
// Delete a job.
155155
System.out.println("**** Delete a Job with name dapr-jobs-1 *****");
156156
client.deleteJob(new DeleteJobRequest("dapr-job-1")).block();
157157
}

0 commit comments

Comments
 (0)