You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2026/09/01 13:22:00 UTC
[jira] [Commented] (CAMEL-11114) Create cache DSL
[ https://issues.apache.org/jira/browse/CAMEL-11114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18110287#comment-18110287 ]
Guillaume Nodet commented on CAMEL-11114:
-----------------------------------------
Fixed via PR https://github.com/apache/camel/pull/25731 (squash-merged to main).
Adds a new Cache EIP with block-scoped read-through caching backed by the KeyValueRepository SPI. Supports Java DSL (.cache()), XML DSL (<cache>), and YAML DSL with configurable TTL, auto-discovery of KeyValueRepository beans, and graceful cache error handling.
> Create cache DSL
> ----------------
>
> Key: CAMEL-11114
> URL: https://issues.apache.org/jira/browse/CAMEL-11114
> Project: Camel
> Issue Type: New Feature
> Components: camel-core, eip
> Reporter: Nicola Ferraro
> Assignee: Guillaume Nodet
> Priority: Major
> Fix For: 4.23.0
>
>
> We should evaluate adding a new "cache" dsl that can be used with all cache components in Camel. A default implementation may use also caffeine, included in camel-core.
> A possible usage example may be:
> {code}
> from("xxx")
> .cache().on("${header.yyy}").ttl(600000) // caches the body
> .to("http4://a-service-that-makes-me-pay-for-each-request.com/api/expensive-endpoint")
> .transform().zzz()
> .to("http4://or-a-service-that-i-can-call-few-times-a-day.com/api/limited-endpoint")
> .unmarshal()
> .endCache()
> {code}
> It should be also useful to protect internal services when using Camel e.g. as a api-gateway (almost what hystrix does in case of failure of the target host).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)