camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashwin Karpe (JIRA)" <j...@apache.org>
Subject [jira] Created: (CAMEL-1900) Need to allow adding of model definitions and processors in camel components without involving the camel-core
Date Tue, 11 Aug 2009 19:29:37 GMT
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


Please see the synopsis of my problem below...

- Ashwin

============================================================================================

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.


Mime
View raw message