CAMEL-23239: Add camel-state-store component with pluggable key-value store#22158
CAMEL-23239: Add camel-state-store component with pluggable key-value store#22158gnodet wants to merge 1 commit intoapache:mainfrom
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
a434f02 to
1e1a769
Compare
|
Hm, this issue doesn't seem to exist on ASF Jira. |
|
The title refers to the wrong issue, CAMEL-23228 is "Add DataWeave to DataSonnet transpiler in camel-jbang". |
|
the commit message also needs to be updated with the correct jira issue number |
apupier
left a comment
There was a problem hiding this comment.
Can you elaborate on the difference between these components and the existing Camel caffeine cache component? https://camel.apache.org/components/4.18.x/caffeine-cache-component.html
… store - New state-store component providing a unified key-value store API - Operations: put, putIfAbsent, get, delete, contains, keys, size, clear - Per-message TTL override via CamelStateStoreTtl header - Multi-module structure with pluggable backends: - camel-state-store: core + in-memory backend (ConcurrentHashMap, lazy TTL) - camel-state-store-caffeine: Caffeine cache with per-entry variable expiry - camel-state-store-redis: Redisson RMapCache with native TTL - camel-state-store-infinispan: Hot Rod client with lifespan TTL - Registered in MojoHelper, parent BOM, allcomponents, catalog - 22 unit tests (core + caffeine) and 15 integration tests (Redis + Infinispan) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1e1a769 to
e3ba53c
Compare
|
Thanks for the reviews! I've pushed an update:
@apupier — regarding the difference with Claude Code on behalf of Guillaume Nodet |
Design note:
|
| [source,java] | ||
| ---- | ||
| @BindToRegistry("infinispanBackend") | ||
| public InfinispanStateStoreBackend infinispan() { |
There was a problem hiding this comment.
@gnodet is this kind of configuration doable only via java beans? would it be possible to provide this configuration via properties?
JIRA: CAMEL-23239
Motivation
Camel provides dedicated components for specific caching/store technologies (Caffeine, Redis, Infinispan, etc.), each with its own API surface. This works well when users need the full feature set of a specific technology, but it creates friction when the actual need is simple: store and retrieve key-value pairs.
The
camel-state-storecomponent follows the same "choose the problem, not the technology" pattern that Camel already uses successfully in other areas:camel-sql/camel-jdbc— generic SQL over any JDBC database, without locking into a vendorcamel-jms— generic messaging over any JMS provider (withcamel-activemq,camel-amqpas pre-configured variants)camel-jcache— generic caching via JSR-107 over any compliant implementationSimilarly,
camel-state-storeprovides a unified key-value API where:Difference from existing cache components
camel-state-storecamel-caffeine-cache/camel-infinispan/ etc.StateStoreBackendinterfaceSummary
camel-state-storecomponent providing a simple, unified key-value store API with pluggable backendsput,putIfAbsent,get,delete,contains,keys,size,clearCamelStateStoreTtlheadercamel-state-store: core + in-memory backend (ConcurrentHashMap, lazy TTL)camel-state-store-caffeine: Caffeine cache with per-entry variable expirycamel-state-store-redis: RedissonRMapCachewith native TTLcamel-state-store-infinispan: Hot Rod client with lifespan TTLStateStoreBackendinterface and bean referencesTest plan
StateStoreTest- 8 tests)StateStoreTtlTest- 2 tests)CaffeineStateStoreBackendTest- 12 tests)RedisStateStoreBackendIT- 8 tests)InfinispanStateStoreBackendIT- 7 tests)formatter:formatandimpsort:sort