GitHub user lburgazzoli opened a pull request:
https://github.com/apache/camel/pull/1436
CAMEL-10542: DataFormat from registry is used for every dataformat
operation (marshal/unmarshal)
I'm opening this PR for review as there are some changes on CamelContext
level so I'd like to gather some feedback.
As today the DataFormat resolution works as follow:
1. search int the registry if a DataFormat instance exists for a given name
2. if not found in registry create a new one from the resources
(META-INF/services/...)
This my cause issues as per CAMEL-10542
The proposed solution introduces a new DataFormatFactory and a new method
to DataFormatResolver to have a way to explicit request for a new instance so
it looks like:
```java
public interface DataFormatResolver {
// Resolve using registry then fallback to createDataFormat
DataFormat resolveDataFormat(String name, CamelContext context);
// Resolve factory using registry or fallback to resources
DataFormat createDataFormat(String name, CamelContext context);
}
```
Model's DataFormatDefinition is now using createDataFormat except for
CustomDataFormat which indeed is supposed to eventually share the same data
format.
I still need to implement some stuffs but the basic concept is here.
Any feedback would be really appreciated.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lburgazzoli/apache-camel CAMEL-10542
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1436.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1436
----
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---