Skip to content

fix: prefer connector virtual thread executor#7233

Open
johnBgood wants to merge 2 commits into
mainfrom
fix/7186-virtual-thread-default
Open

fix: prefer connector virtual thread executor#7233
johnBgood wants to merge 2 commits into
mainfrom
fix/7186-virtual-thread-default

Conversation

@johnBgood
Copy link
Copy Markdown
Collaborator

@johnBgood johnBgood commented May 13, 2026

Description

Fixes the default virtual-thread executor setup for the connector runtime.

The connector runtime already defines a CamundaClientExecutorService backed by virtual threads when camunda.connector.virtual-threads.enabled is missing or set to true. However, Camunda client auto-configuration can create its own fallback CamundaClientExecutorService first. Because both beans are guarded by @ConditionalOnMissingBean, the connector-provided virtual-thread executor may never be created.

This PR makes the connector outbound auto-configuration run before the Camunda client executor auto-configuration, ensuring that the connector-specific virtual-thread executor wins by default.

Changes included:

  • Configure OutboundConnectorsAutoConfiguration before:
    • CamundaAutoConfiguration
    • ExecutorServiceConfiguration
  • Rename the connector executor bean factory method to connectorCamundaClientExecutorService so the bean name is explicit and distinguishable from Camunda’s fallback bean.
  • Add regression tests that verify:
    • the connector executor bean is created by default
    • Camunda’s fallback executor bean is not created when connector virtual threads are enabled
    • disabling camunda.connector.virtual-threads.enabled allows Camunda’s fallback executor to be created
    • the auto-configuration ordering includes the Camunda client executor configuration

Related issues

closes #7186

Checklist

  • Backport labels are added if these code changes should be backported. No backport label is added to the latest
    release, as this branch will be rebased onto main before the next release. Example backport labels:
    • backport stable/8.8: for changes that should be included in the next 8.8.x release.
    • or backport release-8.8.7: for changes that should be included in the specific release 8.8.7, and this
      release has already been created. The release branch will be merged back into stable/8.8 later, so the change
      will be included in future 8.8.x releases as well.
  • Tests/Integration tests for the changes have been added if applicable.
  • If the change requires a documentation update, it has been added to the appropriate section in the documentation.

@johnBgood johnBgood self-assigned this May 13, 2026
Copilot AI review requested due to automatic review settings May 13, 2026 12:58
@johnBgood johnBgood requested a review from a team as a code owner May 13, 2026 12:58
@johnBgood johnBgood requested a review from chillleader May 13, 2026 12:58
@johnBgood johnBgood enabled auto-merge May 13, 2026 12:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts Spring Boot auto-configuration ordering in the connector runtime so that the connector-provided CamundaClientExecutorService backed by virtual threads is created by default (preventing Camunda client’s fallback executor from being instantiated first due to @ConditionalOnMissingBean).

Changes:

  • Ensures OutboundConnectorsAutoConfiguration runs before Camunda client auto-configurations (CamundaAutoConfiguration, ExecutorServiceConfiguration) so the virtual-thread executor wins by default.
  • Renames the connector executor bean factory method to produce a distinct bean name (connectorCamundaClientExecutorService).
  • Adds regression tests covering default behavior, disabled virtual-threads behavior, and auto-config ordering metadata.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
connector-runtime/spring-boot-starter-camunda-connectors/src/main/java/io/camunda/connector/runtime/OutboundConnectorsAutoConfiguration.java Forces connector auto-config to run before Camunda client executor auto-config and renames the connector executor bean for clarity.
connector-runtime/spring-boot-starter-camunda-connectors/src/test/java/io/camunda/connector/runtime/OutboundConnectorsAutoConfigurationTest.java Adds tests validating the connector executor wins by default, fallback appears when virtual threads are disabled, and ordering annotations are present.

Comment on lines 41 to 48
matchIfMissing = true)
public CamundaClientExecutorService camundaClientExecutorService(
public CamundaClientExecutorService connectorCamundaClientExecutorService(
@Autowired(required = false) MeterRegistry meterRegistry) {
Comment on lines +46 to +49
private static final String CONNECTOR_EXECUTOR_BEAN_NAME =
"connectorCamundaClientExecutorService";
private static final String CAMUNDA_EXECUTOR_BEAN_NAME = "meteredCamundaClientThreadPool";

@johnBgood
Copy link
Copy Markdown
Collaborator Author

@copilot apply changes based on the comments in this thread

auto-merge was automatically disabled May 13, 2026 13:38

Head branch was pushed to by a user without write access

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

@copilot apply changes based on the comments in this thread

Applied the requested updates from that review thread in commit 7e8e756:

  • kept the explicit connector executor bean name while adding camundaClientExecutorService as an alias for backward compatibility
  • removed the test dependency on Camunda fallback bean name and asserted behavior via CamundaClientExecutorService type + connector bean presence/absence

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • jfrog-prod-euc1-shared-frankfurt-main.s3.amazonaws.com
    • Triggering command: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java --enable-native-access=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 (dns block)
  • repository.jboss.org
    • Triggering command: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java --enable-native-access=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 (dns block)
  • repository.sonatype.org
    • Triggering command: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java --enable-native-access=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connectors does not start with virtual thread by default

3 participants