lburgazzoli commented on a change in pull request #119: chore: replace custom
properties binding implementation with PropertyBindingSupport from camel support
URL: https://github.com/apache/camel-quarkus/pull/119#discussion_r312168175
##########
File path:
extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java
##########
@@ -331,26 +331,27 @@ protected ReactiveExecutor createReactiveExecutor() {
return new ReactiveExecutorResolver().resolve(this);
}
- public AsyncProcessor createMulticast(Collection<Processor> processors,
ExecutorService executor,
- boolean shutdownExecutorService) {
- return new MulticastProcessor(this, processors, (AggregationStrategy)
null, true, executor, shutdownExecutorService,
- false, false, 0L, (Processor) null, false, false);
+ @Override
+ public AsyncProcessor createMulticast(Collection<Processor> processors,
ExecutorService executor, boolean shutdownExecutorService) {
+ return new MulticastProcessor(this, processors, null, true, executor,
shutdownExecutorService,
+ false, false, 0L, null, false, false);
}
+ @SuppressWarnings("unchecked")
protected <T> T resolve(Class<T> clazz, String type, String name,
CamelContext context) {
T result = context.getRegistry().lookupByNameAndType(name, clazz);
- if (result instanceof CamelContextAware) {
- ((CamelContextAware) result).setCamelContext(context);
- }
- PropertiesComponent comp = getPropertiesComponent();
- if (comp instanceof
org.apache.camel.component.properties.PropertiesComponent) {
- Properties props =
((org.apache.camel.component.properties.PropertiesComponent)
comp).getInitialProperties();
- if (props != null) {
- String pfx = CamelRuntime.PFX_CAMEL + type + "." + name;
- log.debug("Binding {} {} with prefix {}", type, name, pfx);
- RuntimeSupport.bindProperties(this, props, result, pfx);
- }
+
+ CamelContextAware.trySetCamelContext(result, context);
+
+ Properties props = getPropertiesComponent().loadProperties();
+ if (props != null && !props.isEmpty()) {
+ PropertyBindingSupport.bindProperties(
+ this,
+ result,
+ new HashMap<String, Object>((Map) props),
Review comment:
no, leftover from another solution that I had before
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services