fix: prefer connector virtual thread executor#7233
Conversation
There was a problem hiding this comment.
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
OutboundConnectorsAutoConfigurationruns 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. |
| matchIfMissing = true) | ||
| public CamundaClientExecutorService camundaClientExecutorService( | ||
| public CamundaClientExecutorService connectorCamundaClientExecutorService( | ||
| @Autowired(required = false) MeterRegistry meterRegistry) { |
| private static final String CONNECTOR_EXECUTOR_BEAN_NAME = | ||
| "connectorCamundaClientExecutorService"; | ||
| private static final String CAMUNDA_EXECUTOR_BEAN_NAME = "meteredCamundaClientThreadPool"; | ||
|
|
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/camunda/connectors/sessions/eacc814b-6c77-4be1-abe2-51aceeab3f54 Co-authored-by: johnBgood <1797846+johnBgood@users.noreply.github.com>
Head branch was pushed to by a user without write access
Applied the requested updates from that review thread in commit
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:
If you need me to access, download, or install something from one of these locations, you can either:
|
Description
Fixes the default virtual-thread executor setup for the connector runtime.
The connector runtime already defines a
CamundaClientExecutorServicebacked by virtual threads whencamunda.connector.virtual-threads.enabledis missing or set totrue. However, Camunda client auto-configuration can create its own fallbackCamundaClientExecutorServicefirst. 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:
OutboundConnectorsAutoConfigurationbefore:CamundaAutoConfigurationExecutorServiceConfigurationconnectorCamundaClientExecutorServiceso the bean name is explicit and distinguishable from Camunda’s fallback bean.camunda.connector.virtual-threads.enabledallows Camunda’s fallback executor to be createdRelated issues
closes #7186
Checklist
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.backport release-8.8.7: for changes that should be included in the specific release 8.8.7, and thisrelease 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.