Auto-Configuration for Camel-Master Service-Selector
- Dominant language
- Java
- Stars
- 302
- Forks
- 232
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 114
Description
### Bug description
We have multiple Camel-Master Service Providers active in our Quarkus camel app with
* Quarkus v3.8.6
* Camel-Quarkus v3.8.3
* Camel v4.4.3
Therefore we would like to replace the default SelectSingle selector [1] with the `SelectByOrder` implementation. For this we use the property `camel.component.master.service-selector`. Since an instance is expected as the value, we have also written a simple converter:
```java
@Converter
public class ClusterSelectorConverter {
@Converter
public CamelClusterService.Selector convert(String selectorClass) {
try {
return (CamelClusterService.Selector)Class.forName(selectorClass).getConstructor().newInstance();
} catch (Exception ex) {
throw new IllegalStateException(ex);
}
}
}
```
This all works, but the auto-configuration mechanism [2] takes effect too late: the master component has already been initialized with the default selector [3].
How can the selector be configured “correctly”?
Thank you!
#
[1] org.apache.camel.support.cluster.ClusterServiceSelectors#DEFAULT_SELECTOR
[2] MainHelper.setPropertiesOnTarget:323
[3] MainHelper.setPropertiesOnTarget:303
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing MainHelper.setPropertiesOnTarget around lines 303 and 323, then inspect how Camel-Master initializes its service selector and how the Quarkus application properties are applied. Reproduce the configuration with the versions and converter shown in the issue; done means the configured SelectByOrder selector is applied before the master component initializes instead of retaining the default selector.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100