Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
saksham2105 committed Jul 5, 2024
1 parent 158a36d commit 069350a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 61 deletions.
28 changes: 1 addition & 27 deletions src/main/java/io/orkes/samples/OrkesWorkersApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -108,7 +82,7 @@ public TaskRunnerConfigurer taskRunnerConfigurer(List<Worker> 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;
Expand Down
34 changes: 0 additions & 34 deletions src/main/java/io/orkes/samples/workers/IntegrationsWorker.java

This file was deleted.

0 comments on commit 069350a

Please sign in to comment.