You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2009/08/12 07:48:35 UTC

[jira] Commented: (CAMEL-1900) Need to allow adding of model definitions and processors in camel components without involving the camel-core

    [ https://issues.apache.org/activemq/browse/CAMEL-1900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53589#action_53589 ] 

Claus Ibsen commented on CAMEL-1900:
------------------------------------

This is *not* possible with the Java language itself.
Its just not dynamic/flexible enough to allow this.

In the XML would you could have different XSD for 3rd party components but that just adds all the overhead of adding that to XML files. 
Just look at another integration kit and you see the XML declaration explode when you use X+ components.

What we could do is to consider adding the needed DSL in camel-core as a thin wrapper as we do with data formats.
In case we think its feasible to add more to the DSL that is _large_ enough already.

I would rather look for a generic DSL where you could specify a command name and varargs as parameters.

> Need to allow adding of model definitions and processors in camel components without involving the camel-core
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1900
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1900
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Ashwin Karpe
>             Fix For: Future
>
>
> Please see the synopsis of my problem below...
> =================================================================================
> I recently submitted an camel-cache component based on Ehcache to the Apache Camel community (CAMEL-1868). The component has an event based Cache consumer and a Cache Producer to write to the cache.
>  
> I was planning on adding several processors that would do selective cache contents based replacement at the payload/token/XPath level. I have the code written and working however, I was planning on adding a nice model definition to bring it all together via DSL. This is where I ran into a serious problem. The problem is the following
>  
>          a> The processors are in the cache component and I extended the base interface processor and I can do the following in unit tests and it works.
>                     from("cache://TestCache1").
>                           filter(header("CACHE_KEY").isEqualTo("quote")).
>                           process (new CacheBasedTokenReplacer("cache://TestCache1","cache_key","##tag##")).
>                           to("direct:next");
>          b> I put together a CamelCacheDefinition class (see attached)
>                in the camel-cache component (not camel-core)
>                that uses package org.apache.camel.model.cache
>                and extends ProcessorDefinition<CacheProcessorDefinition> from package org.apache.camel.model 
>          c> I would like the following effect                   
>                     from("cache://TestCache1").
>                           filter(header("CACHE_KEY").isEqualTo("quote")).
>                           applycachevalue("cache://TestCache1","cache_key","##tag##").
>                           to("direct:next");
>  
> The problem is that when I develop the unit test and try to do intellisense, I do not see applycachevalue() against ProcessorDefinition (this part I understand, since it is not seeing the CacheDefinition entry) since this capabilty comes from the processorDefinition in came-core. What I am trying to see is 
>           a> How can I do this without having to modify the ProcessorDefinition in camel-core and keep my CacheDefinition in the camel-cache component. 
>           b> I do not wish to add the ehCache dependency in the camel-core and bloat the core. Also, the Producer and Consumer ehCache components are all related to the processors and I would like to avoid fragmentation of the processors from the components.
>           b> If not and I do have to move the CacheDefinition into the camel-core, can I still keep the processors in camel-cache component and intellisense without side-effects ( I suspect I can through the groups setup in camel-core but I need to verify)
>  
> ======================================================================================

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.