Repository navigation
Description
Describe the bug
clusterDefinitions (introduced in 0.22.0 as the replacement for the now-deprecated inline targetCluster) does not support bootstrapServerSelection. The deprecated targetCluster form does. Because the configuration parser rejects unknown properties (FAIL_ON_UNKNOWN_PROPERTIES is enabled), specifying bootstrapServerSelection under a clusterDefinitions entry causes the whole configuration to fail to load with an UnrecognizedPropertyException.
The practical impact: the 0.22.0 deprecation guidance tells users to move from targetCluster to clusterDefinitions, but any user who relies on bootstrap-server selection cannot complete that migration — their config stops loading.
To Reproduce
Configure a clusterDefinition with a bootstrap-server selection strategy:
# NOT allowed today - rejected at parse time
clusterDefinitions:
- name: my-cluster
bootstrapServers: broker-0:9092,broker-1:9092,broker-2:9092
bootstrapServerSelection:
strategy: random
virtualClusters:
- name: my-cluster-proxy
target:
cluster: my-cluster
gateways:
- name: default
portIdentifiesNode:
bootstrapAddress: localhost:9192Start the proxy with this config → it fails to load (Unrecognized field "bootstrapServerSelection").
The equivalent, still using the deprecated form, is accepted:
# Allowed (deprecated targetCluster form)
virtualClusters:
- name: my-cluster-proxy
targetCluster:
bootstrapServers: broker-0:9092,broker-1:9092,broker-2:9092
bootstrapServerSelection:
strategy: random
gateways:
- name: default
portIdentifiesNode:
bootstrapAddress: localhost:9192Expected behavior
clusterDefinitions should accept bootstrapServerSelection with the same semantics as the deprecated targetCluster (strategies round-robin (default) and random), so users can fully migrate off targetCluster without losing functionality.
YAML files and logs
See the two snippets above (the first fails to parse; the second is accepted).
Additional context
- Affected since 0.22.0 (when
clusterDefinitionswas added andtargetClusterdeprecated). - Root cause:
ClusterDefinition(kroxylicious-runtime/.../config/ClusterDefinition.java) lacked abootstrapServerSelectioncomponent, whereasTargetClusterhasselectionStrategy. - Discovered while reviewing docs: use clusterDefinitions instead of targetCluster #4277 #4800 / Update documentation, examples, test code to use
clusterDefinitionsrather thantargetClusters#4277. That PR contains a candidate fix; consider splitting theClusterDefinitionchange into its own PR that closes this issue, and add anadded-type changelog entry for the new config capability.
Activity
k-wall commentedon Sep 3, 2026
Discovered by AzazelSensei in their PR #4277.
feat: accept bootstrapServerSelection on clusterDefinitions kroxylici…
feat: accept bootstrapServerSelection on clusterDefinitions #4840 (#4891
feat: accept bootstrapServerSelection on clusterDefinitions kroxylici…