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-spring-boot.git
The following commit(s) were added to refs/heads/main by this push: new 29618932a77 Regen 29618932a77 is described below commit 29618932a776d30be39832e826297ba9d6ae43f4 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Sun May 4 09:53:31 2025 +0200 Regen --- .../camel/springboot/catalog/components/dapr.json | 76 +++++++++++------ .../camel-dapr-starter/src/main/docs/dapr.json | 31 +++++++ .../springboot/DaprComponentConfiguration.java | 99 +++++++++++++++++++--- .../dapr/springboot/DaprComponentConverter.java | 2 + 4 files changed, 170 insertions(+), 38 deletions(-) diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/dapr.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/dapr.json index d6d4fa4f322..6965ad1db9d 100644 --- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/dapr.json +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/dapr.json @@ -18,25 +18,30 @@ "async": false, "api": false, "consumerOnly": false, - "producerOnly": true, + "producerOnly": false, "lenientProperties": false, "browsable": false, "remote": true }, "componentProperties": { - "concurrency": { "index": 0, "kind": "property", "displayName": "Concurrency", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.StateOptions.Concurrency", "enum": [ "FIRST_WRITE", "LAST_WRITE" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Concurrency mode to use with state oper [...] - "configuration": { "index": 1, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.dapr.DaprConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configurations" }, - "consistency": { "index": 2, "kind": "property", "displayName": "Consistency", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.StateOptions.Consistency", "enum": [ "EVENTUAL", "STRONG" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Consistency level to use with state operations" }, - "eTag": { "index": 3, "kind": "property", "displayName": "ETag", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The eTag for optimistic concurrency during state save or delete operations" }, - "httpExtension": { "index": 4, "kind": "property", "displayName": "Http Extension", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.HttpExtension", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "HTTP method to use when invoking the service. Accepts verbs like [...] - "key": { "index": 5, "kind": "property", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The key used to identify the state object within the specified state store" }, - "lazyStartProducer": { "index": 6, "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 [...] - "methodToInvoke": { "index": 7, "kind": "property", "displayName": "Method To Invoke", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the method or route to invoke on the target service" }, - "serviceToInvoke": { "index": 8, "kind": "property", "displayName": "Service To Invoke", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Target service to invoke. Can be a Dapr App ID, a named HTTPEndpoint, or a FQDN\/public URL" }, - "stateOperation": { "index": 9, "kind": "property", "displayName": "State Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.dapr.StateOperation", "enum": [ "save", "saveBulk", "get", "getBulk", "delete", "executeTransaction" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "get", "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": " [...] - "stateStore": { "index": 10, "kind": "property", "displayName": "State Store", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the Dapr state store to interact with, defined in statestore.yaml config" }, - "verb": { "index": 11, "kind": "property", "displayName": "Verb", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "POST", "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The HTTP verb to use for invoking the method" }, - "autowiredEnabled": { "index": 12, "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 [...] + "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.dapr.DaprConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configurations" }, + "contentType": { "index": 1, "kind": "property", "displayName": "Content Type", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The contentType for the Pub\/Sub component to use." }, + "pubSubName": { "index": 2, "kind": "property", "displayName": "Pub Sub Name", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the Dapr Pub\/Sub component to use. This identifies which underlying messaging system Dapr will intera [...] + "topic": { "index": 3, "kind": "property", "displayName": "Topic", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the topic to subscribe to. The topic must exist in the Pub\/Sub component configured under the given pubsubName." }, + "bridgeErrorHandler": { "index": 4, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] + "previewClient": { "index": 5, "kind": "property", "displayName": "Preview Client", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "io.dapr.client.DaprPreviewClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The client to consume messages by the consumer" }, + "concurrency": { "index": 6, "kind": "property", "displayName": "Concurrency", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.StateOptions.Concurrency", "enum": [ "FIRST_WRITE", "LAST_WRITE" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Concurrency mode to use with state oper [...] + "consistency": { "index": 7, "kind": "property", "displayName": "Consistency", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.StateOptions.Consistency", "enum": [ "EVENTUAL", "STRONG" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Consistency level to use with state operations" }, + "eTag": { "index": 8, "kind": "property", "displayName": "ETag", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The eTag for optimistic concurrency during state save or delete operations" }, + "httpExtension": { "index": 9, "kind": "property", "displayName": "Http Extension", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.HttpExtension", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "HTTP method to use when invoking the service. Accepts verbs like [...] + "key": { "index": 10, "kind": "property", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The key used to identify the state object within the specified state store" }, + "lazyStartProducer": { "index": 11, "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 fai [...] + "methodToInvoke": { "index": 12, "kind": "property", "displayName": "Method To Invoke", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the method or route to invoke on the target service" }, + "serviceToInvoke": { "index": 13, "kind": "property", "displayName": "Service To Invoke", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Target service to invoke. Can be a Dapr App ID, a named HTTPEndpoint, or a FQDN\/public URL" }, + "stateOperation": { "index": 14, "kind": "property", "displayName": "State Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.dapr.StateOperation", "enum": [ "save", "saveBulk", "get", "getBulk", "delete", "executeTransaction" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "get", "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": [...] + "stateStore": { "index": 15, "kind": "property", "displayName": "State Store", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the Dapr state store to interact with, defined in statestore.yaml config" }, + "verb": { "index": 16, "kind": "property", "displayName": "Verb", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "POST", "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The HTTP verb to use for invoking the method" }, + "autowiredEnabled": { "index": 17, "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 [...] }, "headers": { "CamelDaprServiceToInvoke": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Target service to invoke. Can be a Dapr App ID, a named HTTPEndpoint, or a FQDN\/public URL", "constantName": "org.apache.camel.component.dapr.DaprConstants#SERVICE_TO_INVOKE" }, @@ -54,20 +59,39 @@ "CamelDaprMetadata": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Map<String, String>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Additional key-value pairs to be passed to the state store", "constantName": "org.apache.camel.component.dapr.DaprConstants#METADATA" }, "CamelDaprStates": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "List<State<?>>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List of states for bulk save operation", "constantName": "org.apache.camel.component.dapr.DaprConstants#STATES" }, "CamelDaprKeys": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "List<String>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List of keys for bulk get operation", "constantName": "org.apache.camel.component.dapr.DaprConstants#KEYS" }, - "CamelDaprTransactions": { "index": 15, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "List<TransactionalStateOperation<?>>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List of transactions for execute transactions state operations", "constantName": "org.apache.camel.component.dapr.DaprConstants#TRANSACTIONS" } + "CamelDaprTransactions": { "index": 15, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "List<TransactionalStateOperation<?>>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List of transactions for execute transactions state operations", "constantName": "org.apache.camel.component.dapr.DaprConstants#TRANSACTIONS" }, + "CamelDaprPubSubName": { "index": 16, "kind": "header", "displayName": "", "group": "common", "label": "common", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the Dapr Pub\/Sub component to use. This identifies which underlying messaging system Dapr will interact with for publishing or subscribing to events.", "constantName": "org.apache.camel.component.dapr.DaprConstants#PUBSUB_NAME" }, + "CamelDaprTopic": { "index": 17, "kind": "header", "displayName": "", "group": "common", "label": "common", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the topic to subscribe to. The topic must exist in the Pub\/Sub component configured under the given pubsubName.", "constantName": "org.apache.camel.component.dapr.DaprConstants#TOPIC" }, + "CamelDaprContentType": { "index": 18, "kind": "header", "displayName": "", "group": "common", "label": "common", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content type for the Pub\/Sub component to use", "constantName": "org.apache.camel.component.dapr.DaprConstants#CONTENT_TYPE" }, + "CamelDaprID": { "index": 19, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets the unique identifier for the event, used to distinguish it from other events", "constantName": "org.apache.camel.component.dapr.DaprConstants#ID" }, + "CamelDaprSource": { "index": 20, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets the origin of the event, typically a URI indicating the component or service that generated the event", "constantName": "org.apache.camel.component.dapr.DaprConstants#SOURCE" }, + "CamelDaprType": { "index": 21, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets the string indicating the type of cloud event", "constantName": "org.apache.camel.component.dapr.DaprConstants#TYPE" }, + "CamelDaprSpecificVersion": { "index": 22, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets the version of the CloudEvents specification that the event conforms to", "constantName": "org.apache.camel.component.dapr.DaprConstants#SPECIFIC_VERSION" }, + "CamelDaprDataContentType": { "index": 23, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets the content type of the event data", "constantName": "org.apache.camel.component.dapr.DaprConstants#DATA_CONTENT_TYPE" }, + "CamelDaprBinaryData": { "index": 24, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "byte[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets the raw binary data payload of the event, if present (for events where data_base64 is used instead of data)", "constantName": "org.apache.camel.component.dapr.DaprConstants#BINARY_DATA" }, + "CamelDaprTime": { "index": 25, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "OffsetDateTime", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets the timestamp of when the event occurred", "constantName": "org.apache.camel.component.dapr.DaprConstants#TIME" }, + "CamelDaprTraceParent": { "index": 26, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets tracing info for following the event across services (includes trace ID and span ID)", "constantName": "org.apache.camel.component.dapr.DaprConstants#TRACE_PARENT" }, + "CamelDaprTraceState": { "index": 27, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets additional vendor-specific trace context", "constantName": "org.apache.camel.component.dapr.DaprConstants#TRACE_STATE" } }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "object", "javaType": "org.apache.camel.component.dapr.DaprOperation", "enum": [ "invokeService", "state" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The Dapr building block opera [...] - "concurrency": { "index": 1, "kind": "parameter", "displayName": "Concurrency", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.StateOptions.Concurrency", "enum": [ "FIRST_WRITE", "LAST_WRITE" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Concurrency mode to use with state ope [...] - "consistency": { "index": 2, "kind": "parameter", "displayName": "Consistency", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.StateOptions.Consistency", "enum": [ "EVENTUAL", "STRONG" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Consistency level to use with state operations" }, - "eTag": { "index": 3, "kind": "parameter", "displayName": "ETag", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The eTag for optimistic concurrency during state save or delete operations" }, - "httpExtension": { "index": 4, "kind": "parameter", "displayName": "Http Extension", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.HttpExtension", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "HTTP method to use when invoking the service. Accepts verbs lik [...] - "key": { "index": 5, "kind": "parameter", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The key used to identify the state object within the specified state store" }, - "methodToInvoke": { "index": 6, "kind": "parameter", "displayName": "Method To Invoke", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the method or route to invoke on the target service" }, - "serviceToInvoke": { "index": 7, "kind": "parameter", "displayName": "Service To Invoke", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Target service to invoke. Can be a Dapr App ID, a named HTTPEndpoint, or a FQDN\/public URL" }, - "stateOperation": { "index": 8, "kind": "parameter", "displayName": "State Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.dapr.StateOperation", "enum": [ "save", "saveBulk", "get", "getBulk", "delete", "executeTransaction" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "get", "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": [...] - "stateStore": { "index": 9, "kind": "parameter", "displayName": "State Store", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the Dapr state store to interact with, defined in statestore.yaml config" }, - "verb": { "index": 10, "kind": "parameter", "displayName": "Verb", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "POST", "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The HTTP verb to use for invoking the method" }, - "lazyStartProducer": { "index": 11, "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 produ [...] + "contentType": { "index": 1, "kind": "parameter", "displayName": "Content Type", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The contentType for the Pub\/Sub component to use." }, + "pubSubName": { "index": 2, "kind": "parameter", "displayName": "Pub Sub Name", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the Dapr Pub\/Sub component to use. This identifies which underlying messaging system Dapr will inter [...] + "topic": { "index": 3, "kind": "parameter", "displayName": "Topic", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the topic to subscribe to. The topic must exist in the Pub\/Sub component configured under the given pubsubName." }, + "previewClient": { "index": 4, "kind": "parameter", "displayName": "Preview Client", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "io.dapr.client.DaprPreviewClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The client to consume messages by the consumer" }, + "bridgeErrorHandler": { "index": 5, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming [...] + "exceptionHandler": { "index": 6, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By def [...] + "exchangePattern": { "index": 7, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, + "concurrency": { "index": 8, "kind": "parameter", "displayName": "Concurrency", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.StateOptions.Concurrency", "enum": [ "FIRST_WRITE", "LAST_WRITE" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Concurrency mode to use with state ope [...] + "consistency": { "index": 9, "kind": "parameter", "displayName": "Consistency", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.StateOptions.Consistency", "enum": [ "EVENTUAL", "STRONG" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Consistency level to use with state operations" }, + "eTag": { "index": 10, "kind": "parameter", "displayName": "ETag", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The eTag for optimistic concurrency during state save or delete operations" }, + "httpExtension": { "index": 11, "kind": "parameter", "displayName": "Http Extension", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "io.dapr.client.domain.HttpExtension", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "HTTP method to use when invoking the service. Accepts verbs li [...] + "key": { "index": 12, "kind": "parameter", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The key used to identify the state object within the specified state store" }, + "methodToInvoke": { "index": 13, "kind": "parameter", "displayName": "Method To Invoke", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the method or route to invoke on the target service" }, + "serviceToInvoke": { "index": 14, "kind": "parameter", "displayName": "Service To Invoke", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "Target service to invoke. Can be a Dapr App ID, a named HTTPEndpoint, or a FQDN\/public URL" }, + "stateOperation": { "index": 15, "kind": "parameter", "displayName": "State Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.dapr.StateOperation", "enum": [ "save", "saveBulk", "get", "getBulk", "delete", "executeTransaction" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "get", "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": [...] + "stateStore": { "index": 16, "kind": "parameter", "displayName": "State Store", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The name of the Dapr state store to interact with, defined in statestore.yaml config" }, + "verb": { "index": 17, "kind": "parameter", "displayName": "Verb", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "POST", "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The HTTP verb to use for invoking the method" }, + "lazyStartProducer": { "index": 18, "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 produ [...] } } diff --git a/components-starter/camel-dapr-starter/src/main/docs/dapr.json b/components-starter/camel-dapr-starter/src/main/docs/dapr.json index b4135c34e1a..7fe13c334fd 100644 --- a/components-starter/camel-dapr-starter/src/main/docs/dapr.json +++ b/components-starter/camel-dapr-starter/src/main/docs/dapr.json @@ -20,6 +20,13 @@ "sourceType": "org.apache.camel.component.dapr.springboot.DaprComponentConfiguration", "defaultValue": true }, + { + "name": "camel.component.dapr.bridge-error-handler", + "type": "java.lang.Boolean", + "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is n [...] + "sourceType": "org.apache.camel.component.dapr.springboot.DaprComponentConfiguration", + "defaultValue": false + }, { "name": "camel.component.dapr.concurrency", "type": "io.dapr.client.domain.StateOptions$Concurrency", @@ -38,6 +45,12 @@ "description": "Consistency level to use with state operations", "sourceType": "org.apache.camel.component.dapr.springboot.DaprComponentConfiguration" }, + { + "name": "camel.component.dapr.content-type", + "type": "java.lang.String", + "description": "The contentType for the Pub\/Sub component to use.", + "sourceType": "org.apache.camel.component.dapr.springboot.DaprComponentConfiguration" + }, { "name": "camel.component.dapr.customizer.enabled", "type": "java.lang.Boolean", @@ -80,6 +93,18 @@ "description": "The name of the method or route to invoke on the target service", "sourceType": "org.apache.camel.component.dapr.springboot.DaprComponentConfiguration" }, + { + "name": "camel.component.dapr.preview-client", + "type": "io.dapr.client.DaprPreviewClient", + "description": "The client to consume messages by the consumer. The option is a io.dapr.client.DaprPreviewClient type.", + "sourceType": "org.apache.camel.component.dapr.springboot.DaprComponentConfiguration" + }, + { + "name": "camel.component.dapr.pub-sub-name", + "type": "java.lang.String", + "description": "The name of the Dapr Pub\/Sub component to use. This identifies which underlying messaging system Dapr will interact with for publishing or subscribing to events.", + "sourceType": "org.apache.camel.component.dapr.springboot.DaprComponentConfiguration" + }, { "name": "camel.component.dapr.service-to-invoke", "type": "java.lang.String", @@ -99,6 +124,12 @@ "description": "The name of the Dapr state store to interact with, defined in statestore.yaml config", "sourceType": "org.apache.camel.component.dapr.springboot.DaprComponentConfiguration" }, + { + "name": "camel.component.dapr.topic", + "type": "java.lang.String", + "description": "The name of the topic to subscribe to. The topic must exist in the Pub\/Sub component configured under the given pubsubName.", + "sourceType": "org.apache.camel.component.dapr.springboot.DaprComponentConfiguration" + }, { "name": "camel.component.dapr.verb", "type": "java.lang.String", diff --git a/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConfiguration.java b/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConfiguration.java index 0411b484992..de0fb9cef48 100644 --- a/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConfiguration.java +++ b/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConfiguration.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.dapr.springboot; +import io.dapr.client.DaprPreviewClient; import io.dapr.client.domain.HttpExtension; import io.dapr.client.domain.StateOptions.Concurrency; import io.dapr.client.domain.StateOptions.Consistency; @@ -40,15 +41,49 @@ public class DaprComponentConfiguration * enabled by default. */ private Boolean enabled; - /** - * Concurrency mode to use with state operations - */ - private Concurrency concurrency; /** * The component configurations. The option is a * org.apache.camel.component.dapr.DaprConfiguration type. */ private DaprConfiguration configuration; + /** + * The contentType for the Pub/Sub component to use. + */ + private String contentType; + /** + * The name of the Dapr Pub/Sub component to use. This identifies which + * underlying messaging system Dapr will interact with for publishing or + * subscribing to events. + */ + private String pubSubName; + /** + * The name of the topic to subscribe to. The topic must exist in the + * Pub/Sub component configured under the given pubsubName. + */ + private String topic; + /** + * Allows for bridging the consumer to the Camel routing Error Handler, + * which mean any exceptions (if possible) occurred while the Camel consumer + * is trying to pickup incoming messages, or the likes, will now be + * processed as a message and handled by the routing Error Handler. + * Important: This is only possible if the 3rd party component allows Camel + * to be alerted if an exception was thrown. Some components handle this + * internally only, and therefore bridgeErrorHandler is not possible. In + * other situations we may improve the Camel component to hook into the 3rd + * party component and make this possible for future releases. By default + * the consumer will use the org.apache.camel.spi.ExceptionHandler to deal + * with exceptions, that will be logged at WARN or ERROR level and ignored. + */ + private Boolean bridgeErrorHandler = false; + /** + * The client to consume messages by the consumer. The option is a + * io.dapr.client.DaprPreviewClient type. + */ + private DaprPreviewClient previewClient; + /** + * Concurrency mode to use with state operations + */ + private Concurrency concurrency; /** * Consistency level to use with state operations */ @@ -114,14 +149,6 @@ public class DaprComponentConfiguration */ private Boolean autowiredEnabled = true; - public Concurrency getConcurrency() { - return concurrency; - } - - public void setConcurrency(Concurrency concurrency) { - this.concurrency = concurrency; - } - public DaprConfiguration getConfiguration() { return configuration; } @@ -130,6 +157,54 @@ public class DaprComponentConfiguration this.configuration = configuration; } + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public String getPubSubName() { + return pubSubName; + } + + public void setPubSubName(String pubSubName) { + this.pubSubName = pubSubName; + } + + public String getTopic() { + return topic; + } + + public void setTopic(String topic) { + this.topic = topic; + } + + public Boolean getBridgeErrorHandler() { + return bridgeErrorHandler; + } + + public void setBridgeErrorHandler(Boolean bridgeErrorHandler) { + this.bridgeErrorHandler = bridgeErrorHandler; + } + + public DaprPreviewClient getPreviewClient() { + return previewClient; + } + + public void setPreviewClient(DaprPreviewClient previewClient) { + this.previewClient = previewClient; + } + + public Concurrency getConcurrency() { + return concurrency; + } + + public void setConcurrency(Concurrency concurrency) { + this.concurrency = concurrency; + } + public Consistency getConsistency() { return consistency; } diff --git a/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConverter.java b/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConverter.java index f0c56867886..116fcfe267f 100644 --- a/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConverter.java +++ b/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConverter.java @@ -40,6 +40,7 @@ public class DaprComponentConverter implements GenericConverter { public Set<ConvertiblePair> getConvertibleTypes() { Set<ConvertiblePair> answer = new LinkedHashSet<>(); answer.add(new ConvertiblePair(String.class, org.apache.camel.component.dapr.DaprConfiguration.class)); + answer.add(new ConvertiblePair(String.class, io.dapr.client.DaprPreviewClient.class)); answer.add(new ConvertiblePair(String.class, io.dapr.client.domain.HttpExtension.class)); return answer; } @@ -58,6 +59,7 @@ public class DaprComponentConverter implements GenericConverter { ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1); switch (targetType.getName()) { case "org.apache.camel.component.dapr.DaprConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.dapr.DaprConfiguration.class); + case "io.dapr.client.DaprPreviewClient": return applicationContext.getBean(ref, io.dapr.client.DaprPreviewClient.class); case "io.dapr.client.domain.HttpExtension": return applicationContext.getBean(ref, io.dapr.client.domain.HttpExtension.class); } return null;