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

Piotr Klimczak commented on CAMEL-4300:
---------------------------------------

please note that i do not like the setHeader way, neither the when(header()) 
way.
It makes the code muchmore complicated than it should. Such simple things like 
checking was the cache found or not should be done w/o heders.
Right now i am not sure how, but in my opinion using headers should be an 
option instead of beingthe only way.
I am considering something like
.cacheGet(simple("in.body"), true).
whenNotFound().to("seda:prepareValue").end().to("seda:destination");

The second parameter of cacheGet is a flag where true means that the cache will 
be automatically added when the "whenNotFound" block is finished, bu sure is it 
possible right now. It is just an idea. 
But more/less this is how camel-cache of my dreams looks like.

Greetings
Piotr 
                
> camel-cache - Make it possible to specify cache operation / key in endpoint 
> uri
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-4300
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4300
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.8.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.9.0
>
>         Attachments: camel-cache.uri-config-imp.patch
>
>
> Currently you need to provide headers with an operation and key. Instead it 
> should be simpler to do in the uri directly
> .to("cache:myCache?operation=update&key=foo");
> But if there is any headers, then they should take precedence. This is the 
> normal convention with other Camel components. That headers takes precedence 
> over uri configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to