Skip to content

Commit

Permalink
Merge pull request #476 from orkes-io/worker-domain
Browse files Browse the repository at this point in the history
Added Java SDK examples for worker domain
  • Loading branch information
coderabhigupta authored Jul 5, 2023
2 parents f078b05 + a196463 commit ba6fb9f
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 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,27 @@ 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")` |

Code example for `TaskRunner`:
```java dynamic https://github.com/orkes-io/orkes-conductor-client/blob/main/example/java/io/orkes/conductor/sdk/examples/TaskDomainWorker.java#L111-L153 section=1 ../examples/TaskDomainWorker.java
```

<br></br>

Code example for `@WorkerTask`:
```java dynamic https://github.com/orkes-io/orkes-conductor-client/blob/main/example/java/io/orkes/conductor/sdk/examples/TaskDomainWorker.java#L98-L109 section=3 ../examples/TaskDomainWorker.java
```

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

0 comments on commit ba6fb9f

Please sign in to comment.