-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76ed504
commit bfea636
Showing
5 changed files
with
168 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
conductor-clients/java/conductor-java-sdk/conductor-client-metrics/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Conductor Client Metrics | ||
|
||
**Status: Incubating.** | ||
|
||
Provides metrics and monitoring capabilities for Conductor clients. | ||
|
||
It helps developers track the performance and health of their workers, offering insights into task execution times, error rates, and system throughput. | ||
|
||
As an incubating module, it's still under development and subject to changes. |
50 changes: 50 additions & 0 deletions
50
conductor-clients/java/conductor-java-sdk/conductor-client-spring/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Conductor Client Spring | ||
|
||
Provides Spring framework configurations, simplifying the use of Conductor client | ||
in Spring-based applications. | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
- Java 17 or higher | ||
- A Spring boot Project Gradle properly setup with Gradle or Maven | ||
- A running Conductor server (local or remote) | ||
|
||
### Using Conductor Client Spring | ||
|
||
1. **Add `conductor-client-spring` dependency to your project** | ||
|
||
For Gradle: | ||
```groovy | ||
implementation 'org.conductoross:conductor-client-spring:4.0.0' | ||
``` | ||
|
||
For Maven: | ||
```xml | ||
<dependency> | ||
<groupId>org.conductoross</groupId> | ||
<artifactId>conductor-client-spring</artifactId> | ||
<version>4.0.0</version> | ||
</dependency> | ||
``` | ||
|
||
2. Add `com.netflix.conductor` to the component scan packages, e.g.: | ||
|
||
```java | ||
import org.springframework.boot.autoconfigure.SpringBootApplication;; | ||
import org.springframework.context.annotation.ComponentScan; | ||
|
||
@SpringBootApplication | ||
@ComponentScan(basePackages = {"com.netflix.conductor"}) | ||
public class MyApp { | ||
|
||
} | ||
``` | ||
|
||
3. Configure the client in `application.properties` | ||
|
||
```properties | ||
conductor.client.rootUri=http://localhost:8080/api | ||
``` | ||
|
||
> **Note:** We are improving the Spring module to make the integration seamless. SEE: [[Java Client v4] Improve Spring module with auto-configuration](https://github.com/conductor-oss/conductor/issues/285) |
90 changes: 90 additions & 0 deletions
90
conductor-clients/java/conductor-java-sdk/conductor-client/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Conductor Client | ||
|
||
This module provides the core client library to interact with Conductor through its HTTP API, enabling the creation, execution, and management of workflows, while also providing a framework for building workers. | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
- Java 11 or higher | ||
- A Gradle or Maven project properly set up | ||
- A running Conductor server (local or remote) | ||
|
||
### Using Conductor Client | ||
|
||
1. **Add `conductor-client` dependency to your project** | ||
|
||
For Gradle: | ||
```groovy | ||
implementation 'org.conductoross:conductor-client:4.0.0' | ||
``` | ||
|
||
For Maven: | ||
```xml | ||
<dependency> | ||
<groupId>org.conductoross</groupId> | ||
<artifactId>conductor-client</artifactId> | ||
<version>4.0.0</version> | ||
</dependency> | ||
``` | ||
|
||
2. **Create a `ConductorClient` instance** | ||
|
||
Assuming your Conductor server is running at `localhost:8080`: | ||
|
||
```java | ||
import com.netflix.conductor.client.http.ConductorClient; | ||
|
||
// … other code | ||
var client = new ConductorClient("http://localhost:8080/api"); | ||
``` | ||
|
||
> **Note:** Use the Builder to configure options. | ||
3. **Start a Workflow** | ||
|
||
Use the [WorkflowClient](src/main/java/com/netflix/conductor/client/http/WorkflowClient.java) to start a workflow: | ||
|
||
```java | ||
import com.netflix.conductor.client.http.ConductorClient; | ||
import com.netflix.conductor.client.http.WorkflowClient; | ||
import com.netflix.conductor.common.metadata.workflow.StartWorkflowRequest; | ||
|
||
// … other code | ||
var client = new ConductorClient("http://localhost:8080/api"); | ||
var workflowClient = new WorkflowClient(client); | ||
var workflowId = workflowClient.startWorkflow(new StartWorkflowRequest() | ||
.withName("hello_workflow") | ||
.withVersion(1)); | ||
|
||
System.out.println("Started workflow " + workflowId); | ||
``` | ||
|
||
4. **Run a Worker** | ||
|
||
```java | ||
public class HelloWorker implements Worker { | ||
|
||
@Override | ||
public TaskResult execute(Task task) { | ||
var taskResult = new TaskResult(task); | ||
taskResult.setStatus(TaskResult.Status.COMPLETED); | ||
taskResult.getOutputData().put("message", "Hello World!"); | ||
return taskResult; | ||
} | ||
|
||
@Override | ||
public String getTaskDefName() { | ||
return "hello_task"; | ||
} | ||
|
||
public static void main(String[] args) { | ||
var client = new ConductorClient("http://localhost:8080/api"); | ||
var taskClient = new TaskClient(client); | ||
var runnerConfigurer = new TaskRunnerConfigurer | ||
.Builder(taskClient, List.of(new HelloWorker())) | ||
.withThreadCount(10) | ||
.build(); | ||
runnerConfigurer.init(); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Examples | ||
|
||
This module provides simple, illustrative examples to help users get started with the Conductor Java Client/SDK v4. | ||
|
||
It demonstrates basic use cases and integrations, serving as a reference for developers to understand how to use Conductor from their applications. |