I'd like to resume the discussion about this. I still think 3.0 would be the 
best target to get this feature fully supported, but to achieve it in better 
shape, I'd like to have it in 2.19 as well as an experimental, ask feedback and 
then reflect those for 3.0 full support. Fortunately this is purely an addition 
to existing features, i.e. is not breaking any existing API. What do you think?


On 09/17/2016 10:20 PM, Tomohisa Igarashi wrote:
Hi Claus,

Thanks for the reply. Sure that's fine, I agree 3.0 would be better to be 
targeted than 2.x as this introduces some schema updates.

Including this one, I'm always looking for the chance to make any contribution 
to Camel. If there's anything I can help please let me know.


On 09/17/2016 06:33 PM, Claus Ibsen wrote:

Can we take this discussion post Camel 2.18 release.

We are working on the last details to get it ready, and its our main
focus to get this new release out.

After this release we will pickup talks about the next releases
whether that is 2.19 or 3.0, and for the latter what the broad goals
of that is. What you talk about seems more of a 3.0 candidate to me,
than on 2.x.

On Fri, Sep 16, 2016 at 6:50 AM, Tomohisa Igarashi
<tm.igara...@gmail.com> wrote:
Hi Camel developers,

I'd like to propose an enhancement on handling data types of Camel message
contents. To start a smooth discussion I implemented the idea first:

And these testcases demonstrates the declarative transformer usage according
to the declared data types:
[Java DSL]
[Spring DSL]

This adds input/output content type declaration on from and all other
processors. It also introduces well-known Exchange properties, INPUT_TYPE
and OUTPUT_TYPE which are used to specify the current message content type.
The data type is URN like string starts with scheme, like
java:org.example.ItemA or xml:{org.example.xml}ItemA.

If the content type is declared via inputType/outputType/contract, the
ContractProcessor wraps the actual processor and process
transformation/validation according to the type, say if INPUT_TYPE exchange
property has xml:{org.example.xml}ItemA and the declared inputType is
xml:{org.example.xml}ItemB, then it transforms xml:{org.example.xml}ItemA
content into xml:{org.example.xml}ItemB. The <transformers> element which is
introduced right under the <camelContext> is the one to declare the mappings
between transformer implementation and those from/to data type. I
implemented only transformer first, but validator would be brought in in a
same way. This way allows users to make data types visible in the route
definition and keep the transformation/validation apart from route
definition itself.

The most important thing is that the ContractProcessor is involved only when
content type is explicitly declared in a route definition, so that it never
breaks existing camel routes. Ofcourse programatic
transformations/validations we're doing today are still fully available.
It's purely an addition to the existing camel features.

Any thoughts? Does it sound acceptable to get merged into camel? ANY
feedback would be really appreciated!


Reply via email to