diff --git a/src/main/java/io/orkes/samples/OrkesWorkersApplication.java b/src/main/java/io/orkes/samples/OrkesWorkersApplication.java index 4863806..96cda7a 100644 --- a/src/main/java/io/orkes/samples/OrkesWorkersApplication.java +++ b/src/main/java/io/orkes/samples/OrkesWorkersApplication.java @@ -7,7 +7,6 @@ import io.orkes.conductor.client.TaskClient; import io.orkes.conductor.client.WorkflowClient; import io.orkes.conductor.client.automator.TaskRunnerConfigurer; -import io.orkes.conductor.client.http.OrkesIntegrationClient; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.boot.SpringApplication; @@ -66,31 +65,6 @@ public OrkesClients orkesClients() { return orkesClients; } - @Bean - public OrkesIntegrationClient orkesIntegrationClient() { - String rootUri = env.getProperty(CONDUCTOR_SERVER_URL); - String key = env.getProperty(CONDUCTOR_CLIENT_KEY_ID); - String secret = env.getProperty(CONDUCTOR_CLIENT_SECRET); - - if ("_CHANGE_ME_".equals(key) || "_CHANGE_ME_".equals(secret)) { - log.error("Please provide an application key id and secret"); - throw new RuntimeException("No Application Key"); - } - - ApiClient apiClient = null; - - log.info("Conductor Server URL: {}", rootUri); - if(StringUtils.isNotBlank(key) && StringUtils.isNotBlank(secret)) { - log.info("Using Key and Secret to connect to the server"); - apiClient = new ApiClient(rootUri, key, secret); - } else { - log.info("setCredentialsIfPresent: Proceeding without client authentication"); - apiClient = new ApiClient(rootUri); - } - OrkesIntegrationClient orkesIntegrationClient = new OrkesIntegrationClient(apiClient); - return orkesIntegrationClient; - } - @Bean public TaskClient taskClient(OrkesClients orkesClients) { TaskClient taskClient = orkesClients.getTaskClient(); @@ -108,7 +82,7 @@ public TaskRunnerConfigurer taskRunnerConfigurer(List workersList, TaskC log.info("Starting workers : {}", workersList); TaskRunnerConfigurer runnerConfigurer = new TaskRunnerConfigurer .Builder(taskClient, workersList) - .withThreadCount(Math.max(1, workersList.size() * 3)) + .withThreadCount(Math.max(1, workersList.size())) .build(); runnerConfigurer.init(); return runnerConfigurer; diff --git a/src/main/java/io/orkes/samples/workers/IntegrationsWorker.java b/src/main/java/io/orkes/samples/workers/IntegrationsWorker.java deleted file mode 100644 index a40d9ce..0000000 --- a/src/main/java/io/orkes/samples/workers/IntegrationsWorker.java +++ /dev/null @@ -1,34 +0,0 @@ -package io.orkes.samples.workers; - -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.http.OrkesIntegrationClient; -import io.orkes.conductor.client.model.integration.Integration; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -@Slf4j -public class IntegrationsWorker implements Worker { - - @Autowired - private OrkesIntegrationClient orkesIntegrationClient; - - @Override - public String getTaskDefName() { - return "integrations_worker"; - } - - @Override - public TaskResult execute(Task task) { - - TaskResult result = new TaskResult(task); - log.info("Worker integrations_worker is being started"); - result.setStatus(TaskResult.Status.COMPLETED); - Integration integration = orkesIntegrationClient.getIntegration("anthropic_saas"); - System.out.println("Integration is : " + integration); - return result; - } -}