You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/11/07 12:01:59 UTC
[jira] [Commented] (CAMEL-10447) Add contract based type awareness
[ https://issues.apache.org/jira/browse/CAMEL-10447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15643982#comment-15643982 ]
ASF GitHub Bot commented on CAMEL-10447:
----------------------------------------
GitHub user igarashitm opened a pull request:
https://github.com/apache/camel/pull/1252
CAMEL-10447 Add contract based type awareness and transformer which l…
…everages the type metadata
https://issues.apache.org/jira/browse/CAMEL-10447
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/igarashitm/camel CAMEL-10447
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1252.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 #1252
----
commit a40b8326a04699a5f74d475478ba3d6f6b1fa698
Author: Tomohisa Igarashi <tm...@gmail.com>
Date: 2016-07-15T13:41:04Z
CAMEL-10447 Add contract based type awareness and transformer which leverages the type metadata
----
> Add contract based type awareness
> ---------------------------------
>
> Key: CAMEL-10447
> URL: https://issues.apache.org/jira/browse/CAMEL-10447
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Tomohisa Igarashi
> Assignee: Tomohisa Igarashi
>
> Original proposal is available here:
> https://github.com/kcbabo/sandbox/blob/master/camel-metadata.md
> We'd like to propose adding contract based type awareness on the Camel Message Exchange. It introduces following benefits to Camel users:
> * Static evaluation and validation of data types and interactions in an application.
> * Runtime evaluation of data types and interactions
> * The ability to start with a weak/dynamically typed application and move to a statically typed application
> * Support for declarative transformation / automatic type conversion
> * Support for declarative validation of data types
> Let's see the declarative transformation example:
> {code:java}
> from("direct:abc")
> .inputType("java:org.example.Order")
> .to("direct:d")
> .inputType("xml:{org.example}xmlOrder")
> .outputType("urn:acme:orderAck")
> .to("direct:e")
> {code}
> Instead of specifying transform().marshal() programmatically in the route, above declares data type contract of the endpoints. This example means that the input message should be transformed from *java:org.example.Order* to *xml:\{org.example\}xmlOrder* before it is sent to *direct:d* from *direct:abc*.
> Once we add this feature, we can even validate if required transformer is declared along the data type by some maven plugin or IDE at design time.
> The most important thing is that this feature is *completely optional*, so it doesn't make any effect on existing Camel applications at all unless type declaration is explicitly added.
> We've been discussing about this here in camel-dev:
> http://camel.465427.n5.nabble.com/Adding-type-awareness-in-Camel-route-td5787621.html
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)