lburgazzoli opened a new issue #560:
URL: https://github.com/apache/camel-k-runtime/issues/560
The way the `kamelet` component handles properties as today is:
```
camel.kamelet.${templateId}
camel.kamelet.${templateId}.${routeId}
```
But there are some issue with that:
1. the `routeId` may be confusing as it can be used for setting a template
property and as a root for the materialized route properties
2. it uses a non standard prefix as all the component use
`camel.component.${scheme}`
A possible alternative is to to leverage camel's capabilities to use map,
something like:
```
camel.component.kamelet.template-properties[${templateId}][foo] = bar
camel.component.kamelet.route-properties[${routeId}][foo] = bar
```
However it looks quite ugly, a better way would be:
```
camel.component.kamelet.template-properties[${templateId}].foo = bar
camel.component.kamelet.route-properties[${routeId}].foo = bar
```
But I don't think camel is currently able to handle this case so we should
probably enhance the properties binding support, as example we can mark a
component to be `PropertiesAware` so the binding process should not try to bind
the entire object tree but it delegates the mapping to the receiver object.
```java
public interface PropertiesAware {
void setProperties(Map<String, String> properties);
Map<String, String> properties getProperties(Map<String, String>
properties);
}
```
Assuming the component would have been something like:
```java
public class KameletComponent extends DefaultComponent {
private Map<String, PropertiesHolder> templateProperties;
private Map<String, PropertiesHolder> routeProperties;
// getter/Setter omitted
}
public class PropertiesHolder implements PropertiesAware {
@Override
public void setProperties(Map<String, String> properties) { ... }
@Override
public Map<String, String> properties getProperties(Map<String, String>
properties) { ... }
}
```
The binding process then can stop at
`camel.component.kamelet.template-properties[${templateId}]` and `
camel.component.kamelet.route-properties[${routeId}]` and any further
processing should be eventually done by the receiver.
@davsclaus does this make any sense ?
----------------------------------------------------------------
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]