This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 2fc5b2f19664c686514a3407971196abaadfc3cf Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 18:24:17 2026 +0100 CAMEL-23832: camel-state-store - improve the component and option descriptions This commit rewrites the component description and the texts of 5 endpoint options, 2 component options and 3 headers of state-store. The new texts give the backend resolution order (backend, backendFactory, the registry, an in-memory store), which backends namespaced prefixes, which operations need the key header, and that 0 or a negative ttl means no expiry. The old namespaced texts did not say that factory and in-memory backends are never prefixed. Documentation only, no behavior change. The component JSON, the catalog copy, the doc page header and the DSL are regenerated. camel-state-store is marked as done in tasks/component-descriptions.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../camel/catalog/components/state-store.json | 22 +++--- .../camel/catalog/docs/state-store-component.adoc | 2 +- .../camel/component/statestore/state-store.json | 22 +++--- .../src/main/docs/state-store-component.adoc | 2 +- .../component/statestore/StateStoreComponent.java | 10 ++- .../component/statestore/StateStoreConstants.java | 11 ++- .../component/statestore/StateStoreEndpoint.java | 28 ++++++-- .../component/ComponentsBuilderFactory.java | 4 +- .../dsl/StateStoreComponentBuilderFactory.java | 21 +++--- .../builder/endpoint/EndpointHeaderBuilders.java | 4 +- .../builder/endpoint/StaticEndpointBuilders.java | 16 +++-- .../dsl/StateStoreEndpointBuilderFactory.java | 84 +++++++++++++++------- tasks/component-descriptions.md | 2 +- 13 files changed, 146 insertions(+), 82 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/state-store.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/state-store.json index 785e600c6f70..1793c7b5d47b 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/state-store.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/state-store.json @@ -3,7 +3,7 @@ "kind": "component", "name": "state-store", "title": "State Store", - "description": "Perform key-value operations against a pluggable KeyValueRepository backend.", + "description": "Store, get and delete key-value entries in a pluggable KeyValueRepository, such as an in-memory store or a shared cache.", "deprecated": false, "firstVersion": "4.23.0", "label": "cache", @@ -25,25 +25,25 @@ }, "componentProperties": { "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "namespaced": { "index": 1, "kind": "property", "displayName": "Namespaced", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to use a store-specific namespace prefix to isolate keys on a shared backend repository." }, + "namespaced": { "index": 1, "kind": "property", "displayName": "Namespaced", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The default of the namespaced option of the endpoints: whether to prefix the keys with the store name in a backend set on the endpoint or found in the registry, so that stores sharing one repository do not see each other [...] "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "backendFactory": { "index": 3, "kind": "property", "displayName": "Backend Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.statestore.StateStoreBackendFactory", "deprecated": false, "autowired": true, "secret": false, "description": "Factory that creates a dedicated backend for each store name. When set, it takes precedence over registry auto-discovery for endpoints without an explicit backend." } + "backendFactory": { "index": 3, "kind": "property", "displayName": "Backend Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.statestore.StateStoreBackendFactory", "deprecated": false, "autowired": true, "secret": false, "description": "Creates a dedicated backend for each store name, for the endpoints that set no backend. It takes precedence over the KeyValueRepository found in the registry, which is used [...] }, "headers": { - "CamelStateStoreOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.statestore.StateStoreOperations", "enum": [ "put", "putIfAbsent", "get", "delete", "contains", "keys", "size", "clear" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.statestore.StateStoreConstants#OPERATION" }, - "CamelStateStoreKey": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The key to use for the operation", "constantName": "org.apache.camel.component.statestore.StateStoreConstants#KEY" }, - "CamelStateStoreTtl": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "autowired": false, "secret": false, "description": "Per-message TTL override in milliseconds. Takes precedence over the endpoint ttl option.", "constantName": "org.apache.camel.component.statestore.StateStoreConstants#TTL" } + "CamelStateStoreOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.statestore.StateStoreOperations", "enum": [ "put", "putIfAbsent", "get", "delete", "contains", "keys", "size", "clear" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to perform, which overrides the operation option. A String value is matched to the operation name [...] + "CamelStateStoreKey": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The key of the entry. Required by put, putIfAbsent, get, delete and contains; keys, size and clear do not use it.", "constantName": "org.apache.camel.component.statestore.StateStoreConstants#KEY" }, + "CamelStateStoreTtl": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "autowired": false, "secret": false, "description": "The time to live in milliseconds of the entry that put or putIfAbsent stores, which overrides the ttl option. 0 or a negative value means that the entry does not expire.", "constantName": "org.apache.camel.component.statestore.StateStoreConstants#TTL" } }, "bodyTypes": { "producerIn": { "carriers": [ "any" ], "description": "The value to store for put and putIfAbsent, as it is, except a stream: an InputStream or the stream cache of Camel is read into memory and stored as its bytes, and a Reader as its text, a String. The other operations do not use the body" }, "producerOut": { "carriers": [ "unknown" ], "byOption": [ { "option": "operation", "value": "contains", "carriers": [ "value" ], "javaType": "java.lang.Boolean" }, { "option": "operation", "value": "keys", "carriers": [ "list" ], "javaType": "java.util.Set<java.lang.String>" }, { "option": "operation", "value": "size", "carriers": [ "value" ], "javaType": "java.lang.Integer" }, { "option": "operation", "value": "clear", "carriers": [ "null" ] } ], "description": "By the operation, wh [...] }, "properties": { - "storeName": { "index": 0, "kind": "path", "displayName": "Store Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the state store" }, - "namespaced": { "index": 1, "kind": "parameter", "displayName": "Namespaced", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to use a store-specific namespace prefix to isolate keys on a shared backend repository." }, - "operation": { "index": 2, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.component.statestore.StateStoreOperations", "enum": [ "put", "putIfAbsent", "get", "delete", "contains", "keys", "size", "clear" ], "deprecated": false, "autowired": false, "secret": false, "description": "The default operation to perform" }, - "ttl": { "index": 3, "kind": "parameter", "displayName": "Ttl", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "Time-to-live in milliseconds for entries. 0 means no expiry." }, + "storeName": { "index": 0, "kind": "path", "displayName": "Store Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the store. The endpoints with the same store name in one CamelContext share one backend, and the first of them that starts decides which backend it is and whether its keys are namespaced." }, + "namespaced": { "index": 1, "kind": "parameter", "displayName": "Namespaced", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to prefix the keys with the store name in a backend set with the backend option or found in the registry, so that stores sharing one repository do not see each other's keys. When false, keys, size and clear act [...] + "operation": { "index": 2, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.component.statestore.StateStoreOperations", "enum": [ "put", "putIfAbsent", "get", "delete", "contains", "keys", "size", "clear" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to perform when the message has no CamelStateStoreOperation header. Without either, the produ [...] + "ttl": { "index": 3, "kind": "parameter", "displayName": "Ttl", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "The time to live in milliseconds of the entries that put and putIfAbsent store. 0 or a negative value means that the entries do not expire. The CamelStateStoreTtl header overrides it per message." }, "lazyStartProducer": { "index": 4, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] - "backend": { "index": 5, "kind": "parameter", "displayName": "Backend", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.KeyValueRepository", "deprecated": false, "autowired": false, "secret": false, "description": "The backend to use. If not set, auto-discovers a single KeyValueRepository from the registry, or falls back to an in-memory store." } + "backend": { "index": 5, "kind": "parameter", "displayName": "Backend", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.KeyValueRepository", "deprecated": false, "autowired": false, "secret": false, "description": "The KeyValueRepository that holds the entries. If not set, the backendFactory of the component creates one for the store name; without a factory, or when it returns null, the single KeyValueRepository in the [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/state-store-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/state-store-component.adoc index 8bddc34dbb7c..c15d3a5d0f45 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/state-store-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/state-store-component.adoc @@ -2,7 +2,7 @@ :doctitle: State Store :shortname: state-store :artifactid: camel-state-store -:description: Perform key-value operations against a pluggable KeyValueRepository backend. +:description: Store, get and delete key-value entries in a pluggable KeyValueRepository, such as an in-memory store or a shared cache. :since: 4.23 :supportlevel: Preview :tabs-sync-option: diff --git a/components/camel-state-store/camel-state-store/src/generated/resources/META-INF/org/apache/camel/component/statestore/state-store.json b/components/camel-state-store/camel-state-store/src/generated/resources/META-INF/org/apache/camel/component/statestore/state-store.json index 785e600c6f70..1793c7b5d47b 100644 --- a/components/camel-state-store/camel-state-store/src/generated/resources/META-INF/org/apache/camel/component/statestore/state-store.json +++ b/components/camel-state-store/camel-state-store/src/generated/resources/META-INF/org/apache/camel/component/statestore/state-store.json @@ -3,7 +3,7 @@ "kind": "component", "name": "state-store", "title": "State Store", - "description": "Perform key-value operations against a pluggable KeyValueRepository backend.", + "description": "Store, get and delete key-value entries in a pluggable KeyValueRepository, such as an in-memory store or a shared cache.", "deprecated": false, "firstVersion": "4.23.0", "label": "cache", @@ -25,25 +25,25 @@ }, "componentProperties": { "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "namespaced": { "index": 1, "kind": "property", "displayName": "Namespaced", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to use a store-specific namespace prefix to isolate keys on a shared backend repository." }, + "namespaced": { "index": 1, "kind": "property", "displayName": "Namespaced", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The default of the namespaced option of the endpoints: whether to prefix the keys with the store name in a backend set on the endpoint or found in the registry, so that stores sharing one repository do not see each other [...] "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "backendFactory": { "index": 3, "kind": "property", "displayName": "Backend Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.statestore.StateStoreBackendFactory", "deprecated": false, "autowired": true, "secret": false, "description": "Factory that creates a dedicated backend for each store name. When set, it takes precedence over registry auto-discovery for endpoints without an explicit backend." } + "backendFactory": { "index": 3, "kind": "property", "displayName": "Backend Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.statestore.StateStoreBackendFactory", "deprecated": false, "autowired": true, "secret": false, "description": "Creates a dedicated backend for each store name, for the endpoints that set no backend. It takes precedence over the KeyValueRepository found in the registry, which is used [...] }, "headers": { - "CamelStateStoreOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.statestore.StateStoreOperations", "enum": [ "put", "putIfAbsent", "get", "delete", "contains", "keys", "size", "clear" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.statestore.StateStoreConstants#OPERATION" }, - "CamelStateStoreKey": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The key to use for the operation", "constantName": "org.apache.camel.component.statestore.StateStoreConstants#KEY" }, - "CamelStateStoreTtl": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "autowired": false, "secret": false, "description": "Per-message TTL override in milliseconds. Takes precedence over the endpoint ttl option.", "constantName": "org.apache.camel.component.statestore.StateStoreConstants#TTL" } + "CamelStateStoreOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.statestore.StateStoreOperations", "enum": [ "put", "putIfAbsent", "get", "delete", "contains", "keys", "size", "clear" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to perform, which overrides the operation option. A String value is matched to the operation name [...] + "CamelStateStoreKey": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The key of the entry. Required by put, putIfAbsent, get, delete and contains; keys, size and clear do not use it.", "constantName": "org.apache.camel.component.statestore.StateStoreConstants#KEY" }, + "CamelStateStoreTtl": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "autowired": false, "secret": false, "description": "The time to live in milliseconds of the entry that put or putIfAbsent stores, which overrides the ttl option. 0 or a negative value means that the entry does not expire.", "constantName": "org.apache.camel.component.statestore.StateStoreConstants#TTL" } }, "bodyTypes": { "producerIn": { "carriers": [ "any" ], "description": "The value to store for put and putIfAbsent, as it is, except a stream: an InputStream or the stream cache of Camel is read into memory and stored as its bytes, and a Reader as its text, a String. The other operations do not use the body" }, "producerOut": { "carriers": [ "unknown" ], "byOption": [ { "option": "operation", "value": "contains", "carriers": [ "value" ], "javaType": "java.lang.Boolean" }, { "option": "operation", "value": "keys", "carriers": [ "list" ], "javaType": "java.util.Set<java.lang.String>" }, { "option": "operation", "value": "size", "carriers": [ "value" ], "javaType": "java.lang.Integer" }, { "option": "operation", "value": "clear", "carriers": [ "null" ] } ], "description": "By the operation, wh [...] }, "properties": { - "storeName": { "index": 0, "kind": "path", "displayName": "Store Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the state store" }, - "namespaced": { "index": 1, "kind": "parameter", "displayName": "Namespaced", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to use a store-specific namespace prefix to isolate keys on a shared backend repository." }, - "operation": { "index": 2, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.component.statestore.StateStoreOperations", "enum": [ "put", "putIfAbsent", "get", "delete", "contains", "keys", "size", "clear" ], "deprecated": false, "autowired": false, "secret": false, "description": "The default operation to perform" }, - "ttl": { "index": 3, "kind": "parameter", "displayName": "Ttl", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "Time-to-live in milliseconds for entries. 0 means no expiry." }, + "storeName": { "index": 0, "kind": "path", "displayName": "Store Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the store. The endpoints with the same store name in one CamelContext share one backend, and the first of them that starts decides which backend it is and whether its keys are namespaced." }, + "namespaced": { "index": 1, "kind": "parameter", "displayName": "Namespaced", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to prefix the keys with the store name in a backend set with the backend option or found in the registry, so that stores sharing one repository do not see each other's keys. When false, keys, size and clear act [...] + "operation": { "index": 2, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.component.statestore.StateStoreOperations", "enum": [ "put", "putIfAbsent", "get", "delete", "contains", "keys", "size", "clear" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to perform when the message has no CamelStateStoreOperation header. Without either, the produ [...] + "ttl": { "index": 3, "kind": "parameter", "displayName": "Ttl", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "The time to live in milliseconds of the entries that put and putIfAbsent store. 0 or a negative value means that the entries do not expire. The CamelStateStoreTtl header overrides it per message." }, "lazyStartProducer": { "index": 4, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] - "backend": { "index": 5, "kind": "parameter", "displayName": "Backend", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.KeyValueRepository", "deprecated": false, "autowired": false, "secret": false, "description": "The backend to use. If not set, auto-discovers a single KeyValueRepository from the registry, or falls back to an in-memory store." } + "backend": { "index": 5, "kind": "parameter", "displayName": "Backend", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.KeyValueRepository", "deprecated": false, "autowired": false, "secret": false, "description": "The KeyValueRepository that holds the entries. If not set, the backendFactory of the component creates one for the store name; without a factory, or when it returns null, the single KeyValueRepository in the [...] } } diff --git a/components/camel-state-store/camel-state-store/src/main/docs/state-store-component.adoc b/components/camel-state-store/camel-state-store/src/main/docs/state-store-component.adoc index 8bddc34dbb7c..c15d3a5d0f45 100644 --- a/components/camel-state-store/camel-state-store/src/main/docs/state-store-component.adoc +++ b/components/camel-state-store/camel-state-store/src/main/docs/state-store-component.adoc @@ -2,7 +2,7 @@ :doctitle: State Store :shortname: state-store :artifactid: camel-state-store -:description: Perform key-value operations against a pluggable KeyValueRepository backend. +:description: Store, get and delete key-value entries in a pluggable KeyValueRepository, such as an in-memory store or a shared cache. :since: 4.23 :supportlevel: Preview :tabs-sync-option: diff --git a/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreComponent.java b/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreComponent.java index c5ef6ec2561a..b7b985c6eacc 100644 --- a/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreComponent.java +++ b/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreComponent.java @@ -46,11 +46,15 @@ public class StateStoreComponent extends DefaultComponent { private final AtomicBoolean backendFactoryChecked = new AtomicBoolean(); @Metadata(label = "advanced", autowired = true, - description = "Factory that creates a dedicated backend for each store name. When set, it takes precedence over" - + " registry auto-discovery for endpoints without an explicit backend.") + description = "Creates a dedicated backend for each store name, for the endpoints that set no backend. It takes" + + " precedence over the KeyValueRepository found in the registry, which is used when the" + + " factory returns null. The component starts and stops the backends it creates, and does not" + + " prefix their keys.") private StateStoreBackendFactory backendFactory; - @Metadata(description = "Whether to use a store-specific namespace prefix to isolate keys on a shared backend repository.", + @Metadata(description = "The default of the namespaced option of the endpoints: whether to prefix the keys with the" + + " store name in a backend set on the endpoint or found in the registry, so that stores" + + " sharing one repository do not see each other's keys.", defaultValue = "true") private boolean namespaced = true; diff --git a/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreConstants.java b/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreConstants.java index 8b3ddb8d31a8..3f18606a6059 100644 --- a/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreConstants.java +++ b/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreConstants.java @@ -25,14 +25,19 @@ import org.apache.camel.spi.Metadata; */ public final class StateStoreConstants { - @Metadata(description = "The operation to perform", javaType = "org.apache.camel.component.statestore.StateStoreOperations", + @Metadata(description = "The operation to perform, which overrides the operation option. A String value is matched to" + + " the operation name ignoring case.", + javaType = "org.apache.camel.component.statestore.StateStoreOperations", label = "producer") public static final String OPERATION = "CamelStateStoreOperation"; - @Metadata(description = "The key to use for the operation", javaType = "String", label = "producer") + @Metadata(description = "The key of the entry. Required by put, putIfAbsent, get, delete and contains; keys, size and" + + " clear do not use it.", + javaType = "String", label = "producer") public static final String KEY = "CamelStateStoreKey"; - @Metadata(description = "Per-message TTL override in milliseconds. Takes precedence over the endpoint ttl option.", + @Metadata(description = "The time to live in milliseconds of the entry that put or putIfAbsent stores, which overrides" + + " the ttl option. 0 or a negative value means that the entry does not expire.", javaType = "Long", label = "producer") public static final String TTL = "CamelStateStoreTtl"; diff --git a/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreEndpoint.java b/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreEndpoint.java index 6e4996087848..9905c53442cd 100644 --- a/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreEndpoint.java +++ b/components/camel-state-store/camel-state-store/src/main/java/org/apache/camel/component/statestore/StateStoreEndpoint.java @@ -31,7 +31,8 @@ import org.apache.camel.spi.UriPath; import org.apache.camel.support.DefaultEndpoint; /** - * Perform key-value operations against a pluggable {@link KeyValueRepository} backend. + * Store, get and delete key-value entries in a pluggable {@link KeyValueRepository}, such as an in-memory store or a + * shared cache. * * @since 4.23 */ @@ -62,21 +63,36 @@ import org.apache.camel.support.DefaultEndpoint; + " stream was stored as a byte array, and a Reader as a String")) public class StateStoreEndpoint extends DefaultEndpoint { - @UriPath(description = "The name of the state store") + @UriPath(description = "The name of the store. The endpoints with the same store name in one CamelContext share one" + + " backend, and the first of them that starts decides which backend it is and whether its" + + " keys are namespaced.") @Metadata(required = true) private String storeName; - @UriParam(description = "The default operation to perform", enums = "put,putIfAbsent,get,delete,contains,keys,size,clear") + @UriParam(description = "The operation to perform when the message has no CamelStateStoreOperation header. Without" + + " either, the producer fails. All operations except keys, size and clear need the key in" + + " the CamelStateStoreKey header.", + enums = "put,putIfAbsent,get,delete,contains,keys,size,clear") private StateStoreOperations operation; - @UriParam(description = "The backend to use. If not set, auto-discovers a single KeyValueRepository from the registry, or falls back to an in-memory store.", + @UriParam(description = "The KeyValueRepository that holds the entries. If not set, the backendFactory of the component" + + " creates one for the store name; without a factory, or when it returns null, the single" + + " KeyValueRepository in the registry is used, and with none or several of them, a new" + + " in-memory store.", label = "advanced") private KeyValueRepository backend; - @UriParam(description = "Time-to-live in milliseconds for entries. 0 means no expiry.", defaultValue = "0") + @UriParam(description = "The time to live in milliseconds of the entries that put and putIfAbsent store. 0 or a" + + " negative value means that the entries do not expire. The CamelStateStoreTtl header" + + " overrides it per message.", + defaultValue = "0") private long ttl; - @UriParam(description = "Whether to use a store-specific namespace prefix to isolate keys on a shared backend repository.", + @UriParam(description = "Whether to prefix the keys with the store name in a backend set with the backend option or" + + " found in the registry, so that stores sharing one repository do not see each other's" + + " keys. When false, keys, size and clear act on all the entries of the repository. An" + + " in-memory store and a backend from the backendFactory of the component are never" + + " prefixed.", defaultValue = "true") private boolean namespaced = true; diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index 940c6c86a2e3..d415e9ed4618 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -5098,8 +5098,8 @@ public interface ComponentsBuilderFactory { } /** * State Store (camel-state-store) - * Perform key-value operations against a pluggable KeyValueRepository - * backend. + * Store, get and delete key-value entries in a pluggable + * KeyValueRepository, such as an in-memory store or a shared cache. * * Category: cache * Since: 4.23 diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/StateStoreComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/StateStoreComponentBuilderFactory.java index 38fcac0c94e5..e61eef636c50 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/StateStoreComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/StateStoreComponentBuilderFactory.java @@ -24,7 +24,8 @@ import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.statestore.StateStoreComponent; /** - * Perform key-value operations against a pluggable KeyValueRepository backend. + * Store, get and delete key-value entries in a pluggable KeyValueRepository, + * such as an in-memory store or a shared cache. * * Generated by camel build tools - do NOT edit this file! */ @@ -33,8 +34,8 @@ public interface StateStoreComponentBuilderFactory { /** * State Store (camel-state-store) - * Perform key-value operations against a pluggable KeyValueRepository - * backend. + * Store, get and delete key-value entries in a pluggable + * KeyValueRepository, such as an in-memory store or a shared cache. * * Category: cache * Since: 4.23 @@ -78,8 +79,10 @@ public interface StateStoreComponentBuilderFactory { /** - * Whether to use a store-specific namespace prefix to isolate keys on a - * shared backend repository. + * The default of the namespaced option of the endpoints: whether to + * prefix the keys with the store name in a backend set on the endpoint + * or found in the registry, so that stores sharing one repository do + * not see each other's keys. * * The option is a: <code>boolean</code> type. * @@ -117,9 +120,11 @@ public interface StateStoreComponentBuilderFactory { } /** - * Factory that creates a dedicated backend for each store name. When - * set, it takes precedence over registry auto-discovery for endpoints - * without an explicit backend. + * Creates a dedicated backend for each store name, for the endpoints + * that set no backend. It takes precedence over the KeyValueRepository + * found in the registry, which is used when the factory returns null. + * The component starts and stops the backends it creates, and does not + * prefix their keys. * * The option is a: * <code>org.apache.camel.component.statestore.StateStoreBackendFactory</code> type. diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java index 3bebc82bced5..c04ebaf01aad 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java @@ -4066,8 +4066,8 @@ public class EndpointHeaderBuilders { } /** * State Store (camel-state-store) - * Perform key-value operations against a pluggable KeyValueRepository - * backend. + * Store, get and delete key-value entries in a pluggable + * KeyValueRepository, such as an in-memory store or a shared cache. * * Category: cache * Since: 4.23 diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index ea19dee5e6de..ceefbe36da1e 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -17514,8 +17514,8 @@ public class StaticEndpointBuilders { } /** * State Store (camel-state-store) - * Perform key-value operations against a pluggable KeyValueRepository - * backend. + * Store, get and delete key-value entries in a pluggable + * KeyValueRepository, such as an in-memory store or a shared cache. * * Category: cache * Since: 4.23 @@ -17524,7 +17524,9 @@ public class StaticEndpointBuilders { * Syntax: <code>state-store:storeName</code> * * Path parameter: storeName (required) - * The name of the state store + * The name of the store. The endpoints with the same store name in one + * CamelContext share one backend, and the first of them that starts decides + * which backend it is and whether its keys are namespaced. * * @param path storeName * @return the dsl builder @@ -17534,8 +17536,8 @@ public class StaticEndpointBuilders { } /** * State Store (camel-state-store) - * Perform key-value operations against a pluggable KeyValueRepository - * backend. + * Store, get and delete key-value entries in a pluggable + * KeyValueRepository, such as an in-memory store or a shared cache. * * Category: cache * Since: 4.23 @@ -17544,7 +17546,9 @@ public class StaticEndpointBuilders { * Syntax: <code>state-store:storeName</code> * * Path parameter: storeName (required) - * The name of the state store + * The name of the store. The endpoints with the same store name in one + * CamelContext share one backend, and the first of them that starts decides + * which backend it is and whether its keys are namespaced. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/StateStoreEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/StateStoreEndpointBuilderFactory.java index 07e647f8339f..9ba2dcfa20ee 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/StateStoreEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/StateStoreEndpointBuilderFactory.java @@ -27,7 +27,8 @@ import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** - * Perform key-value operations against a pluggable KeyValueRepository backend. + * Store, get and delete key-value entries in a pluggable KeyValueRepository, + * such as an in-memory store or a shared cache. * * Generated by camel build tools - do NOT edit this file! */ @@ -45,8 +46,12 @@ public interface StateStoreEndpointBuilderFactory { } /** - * Whether to use a store-specific namespace prefix to isolate keys on a - * shared backend repository. + * Whether to prefix the keys with the store name in a backend set with + * the backend option or found in the registry, so that stores sharing + * one repository do not see each other's keys. When false, keys, size + * and clear act on all the entries of the repository. An in-memory + * store and a backend from the backendFactory of the component are + * never prefixed. * * The option is a: <code>boolean</code> type. * @@ -61,8 +66,12 @@ public interface StateStoreEndpointBuilderFactory { return this; } /** - * Whether to use a store-specific namespace prefix to isolate keys on a - * shared backend repository. + * Whether to prefix the keys with the store name in a backend set with + * the backend option or found in the registry, so that stores sharing + * one repository do not see each other's keys. When false, keys, size + * and clear act on all the entries of the repository. An in-memory + * store and a backend from the backendFactory of the component are + * never prefixed. * * The option will be converted to a <code>boolean</code> type. * @@ -77,7 +86,10 @@ public interface StateStoreEndpointBuilderFactory { return this; } /** - * The default operation to perform. + * The operation to perform when the message has no + * CamelStateStoreOperation header. Without either, the producer fails. + * All operations except keys, size and clear need the key in the + * CamelStateStoreKey header. * * The option is a: * <code>org.apache.camel.component.statestore.StateStoreOperations</code> type. @@ -92,7 +104,10 @@ public interface StateStoreEndpointBuilderFactory { return this; } /** - * The default operation to perform. + * The operation to perform when the message has no + * CamelStateStoreOperation header. Without either, the producer fails. + * All operations except keys, size and clear need the key in the + * CamelStateStoreKey header. * * The option will be converted to a * <code>org.apache.camel.component.statestore.StateStoreOperations</code> type. @@ -107,7 +122,9 @@ public interface StateStoreEndpointBuilderFactory { return this; } /** - * Time-to-live in milliseconds for entries. 0 means no expiry. + * The time to live in milliseconds of the entries that put and + * putIfAbsent store. 0 or a negative value means that the entries do + * not expire. The CamelStateStoreTtl header overrides it per message. * * The option is a: <code>long</code> type. * @@ -122,7 +139,9 @@ public interface StateStoreEndpointBuilderFactory { return this; } /** - * Time-to-live in milliseconds for entries. 0 means no expiry. + * The time to live in milliseconds of the entries that put and + * putIfAbsent store. 0 or a negative value means that the entries do + * not expire. The CamelStateStoreTtl header overrides it per message. * * The option will be converted to a <code>long</code> type. * @@ -195,9 +214,11 @@ public interface StateStoreEndpointBuilderFactory { return this; } /** - * The backend to use. If not set, auto-discovers a single - * KeyValueRepository from the registry, or falls back to an in-memory - * store. + * The KeyValueRepository that holds the entries. If not set, the + * backendFactory of the component creates one for the store name; + * without a factory, or when it returns null, the single + * KeyValueRepository in the registry is used, and with none or several + * of them, a new in-memory store. * * The option is a: <code>org.apache.camel.spi.KeyValueRepository</code> * type. @@ -212,9 +233,11 @@ public interface StateStoreEndpointBuilderFactory { return this; } /** - * The backend to use. If not set, auto-discovers a single - * KeyValueRepository from the registry, or falls back to an in-memory - * store. + * The KeyValueRepository that holds the entries. If not set, the + * backendFactory of the component creates one for the store name; + * without a factory, or when it returns null, the single + * KeyValueRepository in the registry is used, and with none or several + * of them, a new in-memory store. * * The option will be converted to a * <code>org.apache.camel.spi.KeyValueRepository</code> type. @@ -233,8 +256,8 @@ public interface StateStoreEndpointBuilderFactory { public interface StateStoreBuilders { /** * State Store (camel-state-store) - * Perform key-value operations against a pluggable KeyValueRepository - * backend. + * Store, get and delete key-value entries in a pluggable + * KeyValueRepository, such as an in-memory store or a shared cache. * * Category: cache * Since: 4.23 @@ -247,8 +270,8 @@ public interface StateStoreEndpointBuilderFactory { } /** * State Store (camel-state-store) - * Perform key-value operations against a pluggable KeyValueRepository - * backend. + * Store, get and delete key-value entries in a pluggable + * KeyValueRepository, such as an in-memory store or a shared cache. * * Category: cache * Since: 4.23 @@ -257,7 +280,9 @@ public interface StateStoreEndpointBuilderFactory { * Syntax: <code>state-store:storeName</code> * * Path parameter: storeName (required) - * The name of the state store + * The name of the store. The endpoints with the same store name in one + * CamelContext share one backend, and the first of them that starts + * decides which backend it is and whether its keys are namespaced. * * @param path storeName * @return the dsl builder @@ -267,8 +292,8 @@ public interface StateStoreEndpointBuilderFactory { } /** * State Store (camel-state-store) - * Perform key-value operations against a pluggable KeyValueRepository - * backend. + * Store, get and delete key-value entries in a pluggable + * KeyValueRepository, such as an in-memory store or a shared cache. * * Category: cache * Since: 4.23 @@ -277,7 +302,9 @@ public interface StateStoreEndpointBuilderFactory { * Syntax: <code>state-store:storeName</code> * * Path parameter: storeName (required) - * The name of the state store + * The name of the store. The endpoints with the same store name in one + * CamelContext share one backend, and the first of them that starts + * decides which backend it is and whether its keys are namespaced. * * @param componentName to use a custom component name for the endpoint * instead of the default name @@ -300,7 +327,8 @@ public interface StateStoreEndpointBuilderFactory { public static final StateStoreHeaderNameBuilder INSTANCE = new StateStoreHeaderNameBuilder(); /** - * The operation to perform. + * The operation to perform, which overrides the operation option. A + * String value is matched to the operation name ignoring case. * * The option is a: {@code * org.apache.camel.component.statestore.StateStoreOperations} type. @@ -313,7 +341,8 @@ public interface StateStoreEndpointBuilderFactory { return "CamelStateStoreOperation"; } /** - * The key to use for the operation. + * The key of the entry. Required by put, putIfAbsent, get, delete and + * contains; keys, size and clear do not use it. * * The option is a: {@code String} type. * @@ -325,8 +354,9 @@ public interface StateStoreEndpointBuilderFactory { return "CamelStateStoreKey"; } /** - * Per-message TTL override in milliseconds. Takes precedence over the - * endpoint ttl option. + * The time to live in milliseconds of the entry that put or putIfAbsent + * stores, which overrides the ttl option. 0 or a negative value means + * that the entry does not expire. * * The option is a: {@code Long} type. * diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md index 351c106a3da0..9512a99a2ef7 100644 --- a/tasks/component-descriptions.md +++ b/tasks/component-descriptions.md @@ -356,7 +356,7 @@ or removes its row. | camel-spring-ws | spring-ws | yes | | camel-sql | sql, sql-stored | | | camel-ssh | ssh | yes | -| camel-state-store | state-store | | +| camel-state-store | state-store | yes | | camel-stax | stax | yes | | camel-stitch | stitch | | | camel-stream | stream | yes |
