Skip to content

Commit

Permalink
CAMEL-19650: Camel Kafka doesn't honor 'workerPool' configuration (#1…
Browse files Browse the repository at this point in the history
…0827) (#10842)

* CAMEL-19650: Camel Kafka doesn't honor 'workerPool' configuration

Camel kafka component when provided with custom worker pool is ignored and still creates a new pool, this is fixed with check added to use custom worker pool if provided.

* CAMEL-19650: Camel Kafka doesn't honor 'workerPool' configuration

Fixing checkstyle issue

Co-authored-by: Kartik  kalaghatgi <[email protected]>
  • Loading branch information
essobedo and Kartikvk1996 authored Jul 26, 2023
1 parent e8b5b37 commit 0d0a900
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,15 @@ protected void doStart() throws Exception {

// if we are in asynchronous mode we need a worker pool
if (!configuration.isSynchronous() && workerPool == null) {
workerPool = endpoint.createProducerExecutor();
// we create a thread pool so we should also shut it down
shutdownWorkerPool = true;
// If custom worker pool is provided, then use it, else create a new one.
if (configuration.getWorkerPool() != null) {
workerPool = configuration.getWorkerPool();
shutdownWorkerPool = false;
} else {
workerPool = endpoint.createProducerExecutor();
// we create a thread pool so we should also shut it down
shutdownWorkerPool = true;
}
}
}

Expand Down

0 comments on commit 0d0a900

Please sign in to comment.