Skip to content

Commit

Permalink
Changes required for compatibility with new Orkes client
Browse files Browse the repository at this point in the history
  • Loading branch information
jmigueprieto committed Aug 1, 2024
1 parent e639d66 commit ced818e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
17 changes: 3 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ group 'io.orkes.conductor.workers'
version '1.0-SNAPSHOT'

repositories {
mavenLocal()
mavenCentral()
}

ext {
conductorVersion = '3.13.8'
conductorClientVersion = '2.0.7'
conductorClientVersion = '3.0.0-alpha2'
log4jVersion = '2.17.2!!'
jacksonVersion = '2.13.2!!'
lombokVersion = '1.18.28'
Expand All @@ -25,19 +25,14 @@ java {
}

dependencies {
implementation "com.netflix.conductor:conductor-client:${conductorVersion}"
implementation "com.netflix.conductor:conductor-common:${conductorVersion}"
implementation "io.orkes.conductor:orkes-conductor-client:${conductorClientVersion}"
implementation "io.orkes.conductor:client:${conductorClientVersion}"

implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}"
implementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
implementation "org.apache.logging.log4j:log4j-jul:${log4jVersion}"
implementation "org.apache.logging.log4j:log4j-web:${log4jVersion}"
implementation "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}"

implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${jacksonVersion}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jacksonVersion}"
Expand All @@ -53,12 +48,6 @@ test {
useJUnitPlatform()
}

configurations {
all {
exclude group: 'com.github.vmg.protogen', module: 'protogen-annotations'
}
}

application {
mainClassName = 'io.orkes.samples.Main'
}
14 changes: 9 additions & 5 deletions src/main/java/io/orkes/samples/Main.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package io.orkes.samples;

import io.orkes.conductor.client.ApiClient;
import io.orkes.conductor.client.OrkesClients;
import io.orkes.conductor.client.TaskClient;
import io.orkes.conductor.client.api.TaskClient;
import io.orkes.conductor.client.automator.TaskRunnerConfigurer;
import io.orkes.conductor.client.http.clients.OrkesHttpClient;
import io.orkes.conductor.client.http.clients.OrkesTaskClient;
import io.orkes.samples.workers.ApprovalWorker;

import java.util.List;


public class Main {
private static final String ROOT_URI = "http://localhost:8080/api";
private static final String KEY = "_CHANGE_ME_";
Expand All @@ -24,6 +23,11 @@ public static void main(String[] args) {
}

private static TaskClient getTaskClient() {
return new OrkesClients(new ApiClient(ROOT_URI, KEY, SECRET)).getTaskClient();
OrkesHttpClient client = OrkesHttpClient.builder()
.basePath(ROOT_URI)
.keyId(KEY)
.keySecret(SECRET)
.build();
return new OrkesTaskClient(client);
}
}
6 changes: 3 additions & 3 deletions src/main/java/io/orkes/samples/workers/ApprovalWorker.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.orkes.samples.workers;

import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.netflix.conductor.client.worker.Worker;
import com.netflix.conductor.common.metadata.tasks.Task;
import com.netflix.conductor.common.metadata.tasks.TaskResult;
import io.orkes.conductor.client.model.metadata.tasks.Task;
import io.orkes.conductor.client.model.metadata.tasks.TaskResult;
import io.orkes.conductor.client.worker.Worker;
import lombok.SneakyThrows;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down

0 comments on commit ced818e

Please sign in to comment.