Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Java SDK examples for worker domain #476

Merged
merged 6 commits into from
Jul 5, 2023
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions docs/developer-guides/task-to-domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,28 @@ To successfully route a task by domain:

### Configuring Workers with Domain

Let's configure the workers with a domain label called `test`.
Let's configure the workers with a domain label called `test`. Every worker polling for `taskName` will use `test` as domain.

<Tabs>
<TabItem value="Java" lable="Java">

TODO: Coming soon
| Description | PropertyName | Example |
| ------------------------------------------ | -------------------------------------- | ---------------------------------------------- |
| System property by **taskName** | `conductor.worker.${TASK_NAME}.domain` | `conductor.worker.taskName.domain=test` |
| System property for **all** workers | `conductor.worker.all.domain` | `conductor.worker.all.domain=test` |
| Class `TaskRunner` constructor param | `taskToDomain` | `taskToDomain=Map.of("taskName", "test")` |
| Annotation `@WorkerTask` constructor param | `domain` | `@WorkerTask(value="taskName", domain="test")` |
| Environment variable | `CONDUCTOR_WORKER_(.*?)_DOMAIN` | `CONDUCTOR_WORKER_taskName_DOMAIN=test` |

Code example for `TaskRunner`:
```java dynamic https://github.com/orkes-io/orkes-conductor-client/blob/3903a87320a4bb0907d55f1a6c0996be91bb7f73/src/test/java/io/orkes/conductor/client/worker/TaskToDomainTests.java section=1 ../worker/TaskToDomainTests.java
```

<br></br>

Code example for `@WorkerTask`:
```java dynamic https://github.com/conductor-sdk/orkes-java-springboot2-example/blob/add-worker-domain/src/main/java/io/orkes/example/banking/workers/ConductorWorkers.java section=3 ../workers/ConductorWorkers.java
```

</TabItem>
<TabItem value="Python" label="Python">
Expand Down