You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2025/05/04 07:00:14 UTC
(camel) branch main updated: CAMEL-15088: camel-dapr - add pubSub operation, consumer (#17956)
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
The following commit(s) were added to refs/heads/main by this push:
new dd688e82131 CAMEL-15088: camel-dapr - add pubSub operation, consumer (#17956)
dd688e82131 is described below
commit dd688e821315a7375ff1328a7bac600c28082018
Author: Anirudh Prakash <10...@users.noreply.github.com>
AuthorDate: Sun May 4 12:30:09 2025 +0530
CAMEL-15088: camel-dapr - add pubSub operation, consumer (#17956)
---
.../org/apache/camel/catalog/components/dapr.json | 76 ++-
.../component/dapr/DaprComponentConfigurer.java | 29 +-
.../component/dapr/DaprEndpointConfigurer.java | 41 +-
.../component/dapr/DaprEndpointUriFactory.java | 9 +-
.../org/apache/camel/component/dapr/dapr.json | 76 ++-
.../camel-dapr/src/main/docs/dapr-component.adoc | 44 +-
.../camel/component/dapr/DaprConfiguration.java | 63 +++
.../dapr/DaprConfigurationOptionsProxy.java | 12 +
.../apache/camel/component/dapr/DaprConstants.java | 39 ++
.../apache/camel/component/dapr/DaprConsumer.java | 135 ++++++
.../apache/camel/component/dapr/DaprEndpoint.java | 4 +-
.../camel/component/dapr/DaprExchangeHeaders.java | 12 +
.../apache/camel/component/dapr/DaprOperation.java | 3 +-
.../dapr/operations/DaprOperationManager.java | 1 +
.../dapr/operations/DaprPubSubHandler.java | 61 +++
.../camel/component/dapr/DaprConsumerTest.java | 145 ++++++
.../component/dapr/operations/DaprPubSubTest.java | 88 ++++
.../component/dsl/DaprComponentBuilderFactory.java | 121 ++++-
.../endpoint/dsl/DaprEndpointBuilderFactory.java | 531 ++++++++++++++++++++-
19 files changed, 1389 insertions(+), 101 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dapr.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dapr.json
index 1e373f4cebf..b9f3f10440c 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dapr.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/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/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprComponentConfigurer.java b/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprComponentConfigurer.java
index 9e58076fc4a..392a9f0324d 100644
--- a/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprComponentConfigurer.java
+++ b/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprComponentConfigurer.java
@@ -32,9 +32,13 @@ public class DaprComponentConfigurer extends PropertyConfigurerSupport implement
switch (ignoreCase ? name.toLowerCase() : name) {
case "autowiredenabled":
case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
case "concurrency": getOrCreateConfiguration(target).setConcurrency(property(camelContext, io.dapr.client.domain.StateOptions.Concurrency.class, value)); return true;
case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.dapr.DaprConfiguration.class, value)); return true;
case "consistency": getOrCreateConfiguration(target).setConsistency(property(camelContext, io.dapr.client.domain.StateOptions.Consistency.class, value)); return true;
+ case "contenttype":
+ case "contentType": getOrCreateConfiguration(target).setContentType(property(camelContext, java.lang.String.class, value)); return true;
case "etag":
case "eTag": getOrCreateConfiguration(target).setETag(property(camelContext, java.lang.String.class, value)); return true;
case "httpextension":
@@ -44,12 +48,17 @@ public class DaprComponentConfigurer extends PropertyConfigurerSupport implement
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "methodtoinvoke":
case "methodToInvoke": getOrCreateConfiguration(target).setMethodToInvoke(property(camelContext, java.lang.String.class, value)); return true;
+ case "previewclient":
+ case "previewClient": getOrCreateConfiguration(target).setPreviewClient(property(camelContext, io.dapr.client.DaprPreviewClient.class, value)); return true;
+ case "pubsubname":
+ case "pubSubName": getOrCreateConfiguration(target).setPubSubName(property(camelContext, java.lang.String.class, value)); return true;
case "servicetoinvoke":
case "serviceToInvoke": getOrCreateConfiguration(target).setServiceToInvoke(property(camelContext, java.lang.String.class, value)); return true;
case "stateoperation":
case "stateOperation": getOrCreateConfiguration(target).setStateOperation(property(camelContext, org.apache.camel.component.dapr.StateOperation.class, value)); return true;
case "statestore":
case "stateStore": getOrCreateConfiguration(target).setStateStore(property(camelContext, java.lang.String.class, value)); return true;
+ case "topic": getOrCreateConfiguration(target).setTopic(property(camelContext, java.lang.String.class, value)); return true;
case "verb": getOrCreateConfiguration(target).setVerb(property(camelContext, java.lang.String.class, value)); return true;
default: return false;
}
@@ -57,7 +66,7 @@ public class DaprComponentConfigurer extends PropertyConfigurerSupport implement
@Override
public String[] getAutowiredNames() {
- return new String[]{"httpExtension"};
+ return new String[]{"httpExtension", "previewClient"};
}
@Override
@@ -65,9 +74,13 @@ public class DaprComponentConfigurer extends PropertyConfigurerSupport implement
switch (ignoreCase ? name.toLowerCase() : name) {
case "autowiredenabled":
case "autowiredEnabled": return boolean.class;
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return boolean.class;
case "concurrency": return io.dapr.client.domain.StateOptions.Concurrency.class;
case "configuration": return org.apache.camel.component.dapr.DaprConfiguration.class;
case "consistency": return io.dapr.client.domain.StateOptions.Consistency.class;
+ case "contenttype":
+ case "contentType": return java.lang.String.class;
case "etag":
case "eTag": return java.lang.String.class;
case "httpextension":
@@ -77,12 +90,17 @@ public class DaprComponentConfigurer extends PropertyConfigurerSupport implement
case "lazyStartProducer": return boolean.class;
case "methodtoinvoke":
case "methodToInvoke": return java.lang.String.class;
+ case "previewclient":
+ case "previewClient": return io.dapr.client.DaprPreviewClient.class;
+ case "pubsubname":
+ case "pubSubName": return java.lang.String.class;
case "servicetoinvoke":
case "serviceToInvoke": return java.lang.String.class;
case "stateoperation":
case "stateOperation": return org.apache.camel.component.dapr.StateOperation.class;
case "statestore":
case "stateStore": return java.lang.String.class;
+ case "topic": return java.lang.String.class;
case "verb": return java.lang.String.class;
default: return null;
}
@@ -94,9 +112,13 @@ public class DaprComponentConfigurer extends PropertyConfigurerSupport implement
switch (ignoreCase ? name.toLowerCase() : name) {
case "autowiredenabled":
case "autowiredEnabled": return target.isAutowiredEnabled();
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return target.isBridgeErrorHandler();
case "concurrency": return getOrCreateConfiguration(target).getConcurrency();
case "configuration": return target.getConfiguration();
case "consistency": return getOrCreateConfiguration(target).getConsistency();
+ case "contenttype":
+ case "contentType": return getOrCreateConfiguration(target).getContentType();
case "etag":
case "eTag": return getOrCreateConfiguration(target).getETag();
case "httpextension":
@@ -106,12 +128,17 @@ public class DaprComponentConfigurer extends PropertyConfigurerSupport implement
case "lazyStartProducer": return target.isLazyStartProducer();
case "methodtoinvoke":
case "methodToInvoke": return getOrCreateConfiguration(target).getMethodToInvoke();
+ case "previewclient":
+ case "previewClient": return getOrCreateConfiguration(target).getPreviewClient();
+ case "pubsubname":
+ case "pubSubName": return getOrCreateConfiguration(target).getPubSubName();
case "servicetoinvoke":
case "serviceToInvoke": return getOrCreateConfiguration(target).getServiceToInvoke();
case "stateoperation":
case "stateOperation": return getOrCreateConfiguration(target).getStateOperation();
case "statestore":
case "stateStore": return getOrCreateConfiguration(target).getStateStore();
+ case "topic": return getOrCreateConfiguration(target).getTopic();
case "verb": return getOrCreateConfiguration(target).getVerb();
default: return null;
}
diff --git a/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprEndpointConfigurer.java b/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprEndpointConfigurer.java
index f3ccf0aa52b..c4f0acb0dab 100644
--- a/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprEndpointConfigurer.java
+++ b/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprEndpointConfigurer.java
@@ -23,10 +23,18 @@ public class DaprEndpointConfigurer extends PropertyConfigurerSupport implements
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
DaprEndpoint target = (DaprEndpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
case "concurrency": target.getConfiguration().setConcurrency(property(camelContext, io.dapr.client.domain.StateOptions.Concurrency.class, value)); return true;
case "consistency": target.getConfiguration().setConsistency(property(camelContext, io.dapr.client.domain.StateOptions.Consistency.class, value)); return true;
+ case "contenttype":
+ case "contentType": target.getConfiguration().setContentType(property(camelContext, java.lang.String.class, value)); return true;
case "etag":
case "eTag": target.getConfiguration().setETag(property(camelContext, java.lang.String.class, value)); return true;
+ case "exceptionhandler":
+ case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
+ case "exchangepattern":
+ case "exchangePattern": target.setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true;
case "httpextension":
case "httpExtension": target.getConfiguration().setHttpExtension(property(camelContext, io.dapr.client.domain.HttpExtension.class, value)); return true;
case "key": target.getConfiguration().setKey(property(camelContext, java.lang.String.class, value)); return true;
@@ -34,12 +42,17 @@ public class DaprEndpointConfigurer extends PropertyConfigurerSupport implements
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "methodtoinvoke":
case "methodToInvoke": target.getConfiguration().setMethodToInvoke(property(camelContext, java.lang.String.class, value)); return true;
+ case "previewclient":
+ case "previewClient": target.getConfiguration().setPreviewClient(property(camelContext, io.dapr.client.DaprPreviewClient.class, value)); return true;
+ case "pubsubname":
+ case "pubSubName": target.getConfiguration().setPubSubName(property(camelContext, java.lang.String.class, value)); return true;
case "servicetoinvoke":
case "serviceToInvoke": target.getConfiguration().setServiceToInvoke(property(camelContext, java.lang.String.class, value)); return true;
case "stateoperation":
case "stateOperation": target.getConfiguration().setStateOperation(property(camelContext, org.apache.camel.component.dapr.StateOperation.class, value)); return true;
case "statestore":
case "stateStore": target.getConfiguration().setStateStore(property(camelContext, java.lang.String.class, value)); return true;
+ case "topic": target.getConfiguration().setTopic(property(camelContext, java.lang.String.class, value)); return true;
case "verb": target.getConfiguration().setVerb(property(camelContext, java.lang.String.class, value)); return true;
default: return false;
}
@@ -47,16 +60,24 @@ public class DaprEndpointConfigurer extends PropertyConfigurerSupport implements
@Override
public String[] getAutowiredNames() {
- return new String[]{"httpExtension"};
+ return new String[]{"httpExtension", "previewClient"};
}
@Override
public Class<?> getOptionType(String name, boolean ignoreCase) {
switch (ignoreCase ? name.toLowerCase() : name) {
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return boolean.class;
case "concurrency": return io.dapr.client.domain.StateOptions.Concurrency.class;
case "consistency": return io.dapr.client.domain.StateOptions.Consistency.class;
+ case "contenttype":
+ case "contentType": return java.lang.String.class;
case "etag":
case "eTag": return java.lang.String.class;
+ case "exceptionhandler":
+ case "exceptionHandler": return org.apache.camel.spi.ExceptionHandler.class;
+ case "exchangepattern":
+ case "exchangePattern": return org.apache.camel.ExchangePattern.class;
case "httpextension":
case "httpExtension": return io.dapr.client.domain.HttpExtension.class;
case "key": return java.lang.String.class;
@@ -64,12 +85,17 @@ public class DaprEndpointConfigurer extends PropertyConfigurerSupport implements
case "lazyStartProducer": return boolean.class;
case "methodtoinvoke":
case "methodToInvoke": return java.lang.String.class;
+ case "previewclient":
+ case "previewClient": return io.dapr.client.DaprPreviewClient.class;
+ case "pubsubname":
+ case "pubSubName": return java.lang.String.class;
case "servicetoinvoke":
case "serviceToInvoke": return java.lang.String.class;
case "stateoperation":
case "stateOperation": return org.apache.camel.component.dapr.StateOperation.class;
case "statestore":
case "stateStore": return java.lang.String.class;
+ case "topic": return java.lang.String.class;
case "verb": return java.lang.String.class;
default: return null;
}
@@ -79,10 +105,18 @@ public class DaprEndpointConfigurer extends PropertyConfigurerSupport implements
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
DaprEndpoint target = (DaprEndpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return target.isBridgeErrorHandler();
case "concurrency": return target.getConfiguration().getConcurrency();
case "consistency": return target.getConfiguration().getConsistency();
+ case "contenttype":
+ case "contentType": return target.getConfiguration().getContentType();
case "etag":
case "eTag": return target.getConfiguration().getETag();
+ case "exceptionhandler":
+ case "exceptionHandler": return target.getExceptionHandler();
+ case "exchangepattern":
+ case "exchangePattern": return target.getExchangePattern();
case "httpextension":
case "httpExtension": return target.getConfiguration().getHttpExtension();
case "key": return target.getConfiguration().getKey();
@@ -90,12 +124,17 @@ public class DaprEndpointConfigurer extends PropertyConfigurerSupport implements
case "lazyStartProducer": return target.isLazyStartProducer();
case "methodtoinvoke":
case "methodToInvoke": return target.getConfiguration().getMethodToInvoke();
+ case "previewclient":
+ case "previewClient": return target.getConfiguration().getPreviewClient();
+ case "pubsubname":
+ case "pubSubName": return target.getConfiguration().getPubSubName();
case "servicetoinvoke":
case "serviceToInvoke": return target.getConfiguration().getServiceToInvoke();
case "stateoperation":
case "stateOperation": return target.getConfiguration().getStateOperation();
case "statestore":
case "stateStore": return target.getConfiguration().getStateStore();
+ case "topic": return target.getConfiguration().getTopic();
case "verb": return target.getConfiguration().getVerb();
default: return null;
}
diff --git a/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprEndpointUriFactory.java b/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprEndpointUriFactory.java
index 31cf53fc32c..2d17464cd70 100644
--- a/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprEndpointUriFactory.java
+++ b/components/camel-dapr/src/generated/java/org/apache/camel/component/dapr/DaprEndpointUriFactory.java
@@ -23,18 +23,25 @@ public class DaprEndpointUriFactory extends org.apache.camel.support.component.E
private static final Set<String> SECRET_PROPERTY_NAMES;
private static final Set<String> MULTI_VALUE_PREFIXES;
static {
- Set<String> props = new HashSet<>(12);
+ Set<String> props = new HashSet<>(19);
+ props.add("bridgeErrorHandler");
props.add("concurrency");
props.add("consistency");
+ props.add("contentType");
props.add("eTag");
+ props.add("exceptionHandler");
+ props.add("exchangePattern");
props.add("httpExtension");
props.add("key");
props.add("lazyStartProducer");
props.add("methodToInvoke");
props.add("operation");
+ props.add("previewClient");
+ props.add("pubSubName");
props.add("serviceToInvoke");
props.add("stateOperation");
props.add("stateStore");
+ props.add("topic");
props.add("verb");
PROPERTY_NAMES = Collections.unmodifiableSet(props);
SECRET_PROPERTY_NAMES = Collections.emptySet();
diff --git a/components/camel-dapr/src/generated/resources/META-INF/org/apache/camel/component/dapr/dapr.json b/components/camel-dapr/src/generated/resources/META-INF/org/apache/camel/component/dapr/dapr.json
index 1e373f4cebf..b9f3f10440c 100644
--- a/components/camel-dapr/src/generated/resources/META-INF/org/apache/camel/component/dapr/dapr.json
+++ b/components/camel-dapr/src/generated/resources/META-INF/org/apache/camel/component/dapr/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/camel-dapr/src/main/docs/dapr-component.adoc b/components/camel-dapr/src/main/docs/dapr-component.adoc
index 495478e7286..3b1b1e24db4 100644
--- a/components/camel-dapr/src/main/docs/dapr-component.adoc
+++ b/components/camel-dapr/src/main/docs/dapr-component.adoc
@@ -6,7 +6,7 @@
:since: 4.12
:supportlevel: Preview
:tabs-sync-option:
-:component-header: Only producer is supported
+:component-header: Both producer and consumer are supported
//Manually maintained attributes
:camel-spring-boot-name: dapr
@@ -64,6 +64,14 @@ State management in Dapr allows your application to save, get and delete key-val
|`executeTransaction` |Execute a batch of operations (save or delete) atomically within a transaction. For this operation (List<TransactionalStateOperation<?>>) `transactions` is a required field.
|===
+=== 2. *pubSub*:
+Dapr’s publish-subscribe (Pub/Sub) building block enables asynchronous, event-driven communication between microservices. For this operation, the pubSubName and topic are required.
+
+=== Dapr Consumer operations
+The Dapr Consumer in Apache Camel allows your route to consume events from a Dapr-supported Pub/Sub system. It subscribes to a specified topic on a given pubsub component (pubSubName) and processes incoming CloudEvents as Camel Exchange objects.
+
+To configure a consumer, the pubSubName and topic must be provided. Alternatively, a preconfigured DaprPreviewClient can be registered in the Camel registry to allow the consumer to reuse it instead of creating a new one internally.
+
== Examples
=== Producer Operations Examples
@@ -115,7 +123,7 @@ from("direct:start")
[source,java]
--------------------------------------------------------------------------------
-import org.apache.camel.component.dapr.DaprConstants;from("direct:start")
+from("direct:start")
.process(exchange -> {
// set the header you want the producer to evaluate, refer to the previous
// section to learn about the headers that can be set
@@ -131,7 +139,7 @@ import org.apache.camel.component.dapr.DaprConstants;from("direct:start")
[source,java]
--------------------------------------------------------------------------------
-import org.apache.camel.component.dapr.DaprConstants;from("direct:start")
+from("direct:start")
.process(exchange -> {
// set the header you want the producer to evaluate, refer to the previous
// section to learn about the headers that can be set
@@ -146,7 +154,7 @@ import org.apache.camel.component.dapr.DaprConstants;from("direct:start")
[source,java]
--------------------------------------------------------------------------------
-import org.apache.camel.component.dapr.DaprConstants;from("direct:start")
+from("direct:start")
.process(exchange -> {
// set the header you want the producer to evaluate, refer to the previous
// section to learn about the headers that can be set
@@ -161,7 +169,7 @@ import org.apache.camel.component.dapr.DaprConstants;from("direct:start")
[source,java]
--------------------------------------------------------------------------------
-import org.apache.camel.component.dapr.DaprConstants;from("direct:start")
+from("direct:start")
.process(exchange -> {
// set the header you want the producer to evaluate, refer to the previous
// section to learn about the headers that can be set
@@ -174,4 +182,30 @@ import org.apache.camel.component.dapr.DaprConstants;from("direct:start")
.to("mock:result");
--------------------------------------------------------------------------------
+- `pubSub` -
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:start")
+ .process(exchange -> {
+ // set the header you want the producer to evaluate, refer to the previous
+ // section to learn about the headers that can be set
+ // e.g.:
+ exchange.getIn().setHeader(DaprConstants.CONTENT_TYPE, "application/json");
+ })
+ .to("dapr:pubSub?pubSubName=myPubSub&topic=myTopic")
+ .to("mock:result");
+--------------------------------------------------------------------------------
+
+
+=== Consumer Operations Examples
+- `pubSub` -
+
+[source,java]
+--------------------------------------------------------------------------------
+from("dapr:pubSub?pubSubName=myPubSub&topic=myTopic")
+ .log("Received message from Dapr pubsub: ${body}")
+ .to("mock:result");
+--------------------------------------------------------------------------------
+
include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConfiguration.java b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConfiguration.java
index 67630c4b6f4..7700d9cbd27 100644
--- a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConfiguration.java
+++ b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConfiguration.java
@@ -16,6 +16,7 @@
*/
package org.apache.camel.component.dapr;
+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;
@@ -58,6 +59,17 @@ public class DaprConfiguration implements Cloneable {
private Concurrency concurrency;
@UriParam(label = "producer", description = "Consistency level to use with state operations", enums = "EVENTUAL, STRONG")
private Consistency consistency;
+ @UriParam(label = "consumer", description = "The client to consume messages by the consumer")
+ @Metadata(autowired = true)
+ private DaprPreviewClient previewClient;
+ @UriParam(label = "common", 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.")
+ private String pubSubName;
+ @UriParam(label = "common", description = "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;
+ @UriParam(label = "common", description = "The contentType for the Pub/Sub component to use.")
+ private String contentType;
/**
* The Dapr <b>building block operation</b> to perform with this component
@@ -208,6 +220,57 @@ public class DaprConfiguration implements Cloneable {
this.consistency = consistency;
}
+ /**
+ * The name of the Dapr <b>Pub/Sub component</b> to use.
+ *
+ * <p>
+ * This identifies which underlying messaging system Dapr will interact with for publishing or subscribing to
+ * events.
+ */
+ public String getPubSubName() {
+ return pubSubName;
+ }
+
+ public void setPubSubName(String pubSubName) {
+ this.pubSubName = pubSubName;
+ }
+
+ /**
+ * The name of the <b>topic</b> to subscribe to.
+ *
+ * <p>
+ * The topic must exist in the Pub/Sub component configured under the given pubsubName.
+ */
+ public String getTopic() {
+ return topic;
+ }
+
+ public void setTopic(String topic) {
+ this.topic = topic;
+ }
+
+ /**
+ * The <b>content type</b> for the Pub/Sub component to use.
+ */
+ public String getContentType() {
+ return contentType;
+ }
+
+ public void setContentType(String contentType) {
+ this.contentType = contentType;
+ }
+
+ /**
+ * The <b>preview client</b> to consume messages by the consumer.
+ */
+ public DaprPreviewClient getPreviewClient() {
+ return previewClient;
+ }
+
+ public void setPreviewClient(DaprPreviewClient previewClient) {
+ this.previewClient = previewClient;
+ }
+
public DaprConfiguration copy() {
try {
return (DaprConfiguration) super.clone();
diff --git a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConfigurationOptionsProxy.java b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConfigurationOptionsProxy.java
index 6930ddcfbac..ad709fdb01b 100644
--- a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConfigurationOptionsProxy.java
+++ b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConfigurationOptionsProxy.java
@@ -109,6 +109,18 @@ public class DaprConfigurationOptionsProxy {
return getOption(DaprExchangeHeaders::getTransactionsFromHeaders, () -> null, exchange);
}
+ public String getPubSubName(final Exchange exchange) {
+ return getOption(DaprExchangeHeaders::getPubSubNameFromHeaders, configuration::getPubSubName, exchange);
+ }
+
+ public String getTopic(final Exchange exchange) {
+ return getOption(DaprExchangeHeaders::getTopicFromHeaders, configuration::getTopic, exchange);
+ }
+
+ public String getContentType(final Exchange exchange) {
+ return getOption(DaprExchangeHeaders::getContentTypeFromHeaders, configuration::getContentType, exchange);
+ }
+
private <R> R getOption(final Function<Exchange, R> exchangeFn, final Supplier<R> fallbackFn, final Exchange exchange) {
// we first try to look if our value in exchange otherwise fallback to fallbackFn which could be either a function or constant
return ObjectHelper.isEmpty(exchange) || ObjectHelper.isEmpty(exchangeFn.apply(exchange))
diff --git a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConstants.java b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConstants.java
index 42d386b4cfc..5c87af42e47 100644
--- a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConstants.java
+++ b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConstants.java
@@ -70,4 +70,43 @@ public class DaprConstants {
@Metadata(label = "producer", description = "List of transactions for execute transactions state operations",
javaType = "List<TransactionalStateOperation<?>>")
public static final String TRANSACTIONS = HEADER_PREFIX + "Transactions";
+ @Metadata(label = "common",
+ 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.",
+ javaType = "String")
+ public static final String PUBSUB_NAME = HEADER_PREFIX + "PubSubName";
+ @Metadata(label = "common", description = "The name of the topic to subscribe to. The topic must exist in the Pub/Sub " +
+ "component configured under the given pubsubName.",
+ javaType = "String")
+ public static final String TOPIC = HEADER_PREFIX + "Topic";
+ @Metadata(label = "common", description = "The content type for the Pub/Sub component to use", javaType = "String")
+ public static final String CONTENT_TYPE = HEADER_PREFIX + "ContentType";
+ @Metadata(label = "consumer",
+ description = "Gets the unique identifier for the event, used to distinguish it from other events",
+ javaType = "String")
+ public static final String ID = HEADER_PREFIX + "ID";
+ @Metadata(label = "consumer",
+ description = "Gets the origin of the event, typically a URI indicating the component or service " +
+ "that generated the event",
+ javaType = "String")
+ public static final String SOURCE = HEADER_PREFIX + "Source";
+ @Metadata(label = "consumer", description = "Gets the string indicating the type of cloud event", javaType = "String")
+ public static final String TYPE = HEADER_PREFIX + "Type";
+ @Metadata(label = "consumer", description = "Gets the version of the CloudEvents specification that the event conforms to",
+ javaType = "String")
+ public static final String SPECIFIC_VERSION = HEADER_PREFIX + "SpecificVersion";
+ @Metadata(label = "consumer", description = "Gets the content type of the event data", javaType = "String")
+ public static final String DATA_CONTENT_TYPE = HEADER_PREFIX + "DataContentType";
+ @Metadata(label = "consumer", description = "Gets the raw binary data payload of the event, if present " +
+ "(for events where data_base64 is used instead of data)",
+ javaType = "byte[]")
+ public static final String BINARY_DATA = HEADER_PREFIX + "BinaryData";
+ @Metadata(label = "consumer", description = "Gets the timestamp of when the event occurred", javaType = "OffsetDateTime")
+ public static final String TIME = HEADER_PREFIX + "Time";
+ @Metadata(label = "consumer", description = "Gets tracing info for following the event across services " +
+ "(includes trace ID and span ID)",
+ javaType = "String")
+ public static final String TRACE_PARENT = HEADER_PREFIX + "TraceParent";
+ @Metadata(label = "consumer", description = "Gets additional vendor-specific trace context", javaType = "String")
+ public static final String TRACE_STATE = HEADER_PREFIX + "TraceState";
}
diff --git a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConsumer.java b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConsumer.java
new file mode 100644
index 00000000000..0aed20ef735
--- /dev/null
+++ b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprConsumer.java
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.dapr;
+
+import java.io.Closeable;
+
+import io.dapr.client.DaprClientBuilder;
+import io.dapr.client.DaprPreviewClient;
+import io.dapr.client.SubscriptionListener;
+import io.dapr.client.domain.CloudEvent;
+import io.dapr.utils.TypeRef;
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.Processor;
+import org.apache.camel.support.DefaultConsumer;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import reactor.core.publisher.Mono;
+
+public class DaprConsumer extends DefaultConsumer {
+
+ private static final Logger LOG = LoggerFactory.getLogger(DaprConsumer.class);
+ private final String pubSubName;
+ private final String topic;
+ private DaprPreviewClient client;
+ private Closeable subscription;
+
+ public DaprConsumer(final DaprEndpoint endpoint, final Processor processor) {
+ super(endpoint, processor);
+ pubSubName = endpoint.getConfiguration().getPubSubName();
+ topic = endpoint.getConfiguration().getTopic();
+ client = endpoint.getConfiguration().getPreviewClient();
+ }
+
+ @Override
+ protected void doInit() throws Exception {
+ super.doInit();
+
+ if (client == null && (ObjectHelper.isEmpty(pubSubName) || ObjectHelper.isEmpty(topic))) {
+ throw new IllegalArgumentException("pubSubName and topic are mandatory for subscribe operation");
+ }
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ super.doStart();
+
+ LOG.debug("Creating connection to Dapr");
+
+ if (client == null) {
+ client = new DaprClientBuilder().buildPreviewClient();
+ }
+ subscription = client.subscribeToEvents(pubSubName, topic, new DaprSubscriptionListener(), TypeRef.get(byte[].class));
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ if (subscription != null) {
+ subscription.close();
+ }
+ if (client != null) {
+ client.close();
+ }
+
+ // shutdown camel consumer
+ super.doStop();
+ }
+
+ public DaprConfiguration getConfiguration() {
+ return getEndpoint().getConfiguration();
+ }
+
+ @Override
+ public DaprEndpoint getEndpoint() {
+ return (DaprEndpoint) super.getEndpoint();
+ }
+
+ private Exchange createServiceBusExchange(final CloudEvent<byte[]> cloudEvent) {
+ final Exchange exchange = createExchange(true);
+ final Message message = exchange.getIn();
+
+ // set body
+ message.setBody(cloudEvent.getData());
+
+ // set headers
+ message.setHeader(DaprConstants.PUBSUB_NAME, cloudEvent.getPubsubName());
+ message.setHeader(DaprConstants.TOPIC, cloudEvent.getTopic());
+ message.setHeader(DaprConstants.ID, cloudEvent.getId());
+ message.setHeader(DaprConstants.SOURCE, cloudEvent.getSource());
+ message.setHeader(DaprConstants.TYPE, cloudEvent.getType());
+ message.setHeader(DaprConstants.SPECIFIC_VERSION, cloudEvent.getSpecversion());
+ message.setHeader(DaprConstants.DATA_CONTENT_TYPE, cloudEvent.getDatacontenttype());
+ message.setHeader(DaprConstants.BINARY_DATA, cloudEvent.getBinaryData());
+ message.setHeader(DaprConstants.TIME, cloudEvent.getTime());
+ message.setHeader(DaprConstants.TRACE_PARENT, cloudEvent.getTraceParent());
+ message.setHeader(DaprConstants.TRACE_STATE, cloudEvent.getTraceState());
+
+ return exchange;
+ }
+
+ protected class DaprSubscriptionListener implements SubscriptionListener<byte[]> {
+
+ @Override
+ public Mono<Status> onEvent(CloudEvent<byte[]> cloudEvent) {
+ final Exchange exchange = createServiceBusExchange(cloudEvent);
+
+ // use default consumer callback
+ AsyncCallback cb = defaultConsumerCallback(exchange, true);
+ getAsyncProcessor().process(exchange, cb);
+
+ return Mono.just(Status.SUCCESS);
+ }
+
+ @Override
+ public void onError(RuntimeException ex) {
+ LOG.error("Error from Dapr client: {}", ex.getMessage(), ex);
+ }
+ }
+}
diff --git a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprEndpoint.java b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprEndpoint.java
index 6f8da5ba3ac..641aafc1c27 100644
--- a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprEndpoint.java
+++ b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprEndpoint.java
@@ -29,7 +29,7 @@ import org.apache.camel.support.DefaultEndpoint;
/**
* Dapr component which interfaces with Dapr Building Blocks.
*/
-@UriEndpoint(firstVersion = "4.12.0", scheme = "dapr", title = "Dapr", syntax = "dapr:operation", producerOnly = true,
+@UriEndpoint(firstVersion = "4.12.0", scheme = "dapr", title = "Dapr", syntax = "dapr:operation",
category = { Category.CLOUD, Category.SAAS }, headersClass = DaprConstants.class)
public class DaprEndpoint extends DefaultEndpoint {
@@ -49,7 +49,7 @@ public class DaprEndpoint extends DefaultEndpoint {
@Override
public Consumer createConsumer(Processor processor) throws Exception {
- throw new UnsupportedOperationException("You cannot receive messages from this endpoint");
+ return new DaprConsumer(this, processor);
}
@Override
diff --git a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprExchangeHeaders.java b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprExchangeHeaders.java
index c8a593fafa3..3c485b08fd9 100644
--- a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprExchangeHeaders.java
+++ b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprExchangeHeaders.java
@@ -99,6 +99,18 @@ public class DaprExchangeHeaders {
return getObjectFromHeaders(exchange, DaprConstants.TRANSACTIONS, List.class);
}
+ public static String getPubSubNameFromHeaders(final Exchange exchange) {
+ return getObjectFromHeaders(exchange, DaprConstants.PUBSUB_NAME, String.class);
+ }
+
+ public static String getTopicFromHeaders(final Exchange exchange) {
+ return getObjectFromHeaders(exchange, DaprConstants.TOPIC, String.class);
+ }
+
+ public static String getContentTypeFromHeaders(final Exchange exchange) {
+ return getObjectFromHeaders(exchange, DaprConstants.CONTENT_TYPE, String.class);
+ }
+
private static <T> T getObjectFromHeaders(final Exchange exchange, final String headerName, final Class<T> classType) {
return ObjectHelper.isEmpty(exchange) ? null : exchange.getIn().getHeader(headerName, classType);
}
diff --git a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprOperation.java b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprOperation.java
index acd877af8d5..7da3e05a000 100644
--- a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprOperation.java
+++ b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/DaprOperation.java
@@ -18,5 +18,6 @@ package org.apache.camel.component.dapr;
public enum DaprOperation {
invokeService,
- state
+ state,
+ pubSub
}
diff --git a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/operations/DaprOperationManager.java b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/operations/DaprOperationManager.java
index 386b37101b3..d97fcce8f5e 100644
--- a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/operations/DaprOperationManager.java
+++ b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/operations/DaprOperationManager.java
@@ -32,6 +32,7 @@ public class DaprOperationManager {
this.configurationOptionsProxy = configurationOptionsProxy;
handlerMap.put(DaprOperation.invokeService, new DaprServiceInvocationHandler(configurationOptionsProxy));
handlerMap.put(DaprOperation.state, new DaprStateHandler(configurationOptionsProxy));
+ handlerMap.put(DaprOperation.pubSub, new DaprPubSubHandler(configurationOptionsProxy));
}
public DaprOperationResponse process(Exchange exchange, DaprClient client) throws Exception {
diff --git a/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/operations/DaprPubSubHandler.java b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/operations/DaprPubSubHandler.java
new file mode 100644
index 00000000000..f1378e9ab21
--- /dev/null
+++ b/components/camel-dapr/src/main/java/org/apache/camel/component/dapr/operations/DaprPubSubHandler.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.dapr.operations;
+
+import java.util.Map;
+
+import io.dapr.client.DaprClient;
+import io.dapr.client.domain.PublishEventRequest;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.dapr.DaprConfigurationOptionsProxy;
+import org.apache.camel.util.ObjectHelper;
+
+public class DaprPubSubHandler implements DaprOperationHandler {
+
+ private final DaprConfigurationOptionsProxy configurationOptionsProxy;
+
+ public DaprPubSubHandler(DaprConfigurationOptionsProxy configurationOptionsProxy) {
+ this.configurationOptionsProxy = configurationOptionsProxy;
+ }
+
+ @Override
+ public DaprOperationResponse handle(Exchange exchange, DaprClient client) {
+ Object payload = exchange.getIn().getBody();
+ String pubSubName = configurationOptionsProxy.getPubSubName(exchange);
+ String topic = configurationOptionsProxy.getTopic(exchange);
+ String contentType = configurationOptionsProxy.getContentType(exchange);
+ Map<String, String> metadata = configurationOptionsProxy.getMetadata(exchange);
+
+ PublishEventRequest publishEventRequest = new PublishEventRequest(pubSubName, topic, payload);
+ publishEventRequest.setContentType(contentType);
+ publishEventRequest.setMetadata(metadata);
+
+ client.publishEvent(publishEventRequest).block();
+
+ return DaprOperationResponse.create(publishEventRequest);
+ }
+
+ @Override
+ public void validateConfiguration(Exchange exchange) {
+ String pubSubName = configurationOptionsProxy.getPubSubName(exchange);
+ String topic = configurationOptionsProxy.getTopic(exchange);
+
+ if (ObjectHelper.isEmpty(pubSubName) || ObjectHelper.isEmpty(topic)) {
+ throw new IllegalArgumentException("pubSubName and topic are mandatory for publish operation");
+ }
+ }
+}
diff --git a/components/camel-dapr/src/test/java/org/apache/camel/component/dapr/DaprConsumerTest.java b/components/camel-dapr/src/test/java/org/apache/camel/component/dapr/DaprConsumerTest.java
new file mode 100644
index 00000000000..cef69d130a1
--- /dev/null
+++ b/components/camel-dapr/src/test/java/org/apache/camel/component/dapr/DaprConsumerTest.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.dapr;
+
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+
+import io.dapr.client.DaprClientBuilder;
+import io.dapr.client.DaprPreviewClient;
+import io.dapr.client.Subscription;
+import io.dapr.client.SubscriptionListener;
+import io.dapr.client.domain.CloudEvent;
+import io.dapr.utils.TypeRef;
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.AsyncProcessor;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.spi.ExchangeFactory;
+import org.apache.camel.support.DefaultExchange;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class DaprConsumerTest extends CamelTestSupport {
+
+ private final CamelContext context = mock(CamelContext.class);
+ private final ExtendedCamelContext ecc = mock(ExtendedCamelContext.class);
+ private final ExchangeFactory ef = mock(ExchangeFactory.class);
+ private final AsyncProcessor processor = mock(AsyncProcessor.class);
+ private final DaprEndpoint endpoint = mock(DaprEndpoint.class);
+ private final DaprConfiguration configuration = mock(DaprConfiguration.class);
+ private final DaprPreviewClient mockClient = mock(DaprPreviewClient.class);
+ private final Subscription mockSubscription = mock(Subscription.class);
+
+ private final ArgumentCaptor<SubscriptionListener<byte[]>> listenerCaptor
+ = ArgumentCaptor.forClass(SubscriptionListener.class);
+ private final ArgumentCaptor<Exchange> exchangeCaptor = ArgumentCaptor.forClass(Exchange.class);
+ private final ArgumentCaptor<AsyncCallback> callbackCaptor = ArgumentCaptor.forClass(AsyncCallback.class);
+
+ private DaprConsumer consumer;
+
+ @BeforeEach
+ void beforeEach() throws Exception {
+ when(context.getCamelContextExtension()).thenReturn(ecc);
+ when(ecc.getExchangeFactory()).thenReturn(ef);
+ when(ef.newExchangeFactory(any())).thenReturn(ef);
+ when(ef.create(any(), anyBoolean()))
+ .thenAnswer(inv -> DefaultExchange.newFromEndpoint(inv.getArgument(0)));
+ when(endpoint.getCamelContext()).thenReturn(context);
+ when(endpoint.getConfiguration()).thenReturn(configuration);
+ when(configuration.getPubSubName()).thenReturn("testPubSub");
+ when(configuration.getTopic()).thenReturn("testTopic");
+ when(configuration.getPreviewClient()).thenReturn(mockClient);
+
+ DaprClientBuilder builder = mock(DaprClientBuilder.class);
+ when(builder.buildPreviewClient()).thenReturn(mockClient);
+
+ doReturn(mockSubscription).when(mockClient).subscribeToEvents(
+ anyString(),
+ anyString(),
+ listenerCaptor.capture(),
+ any(TypeRef.class));
+
+ consumer = new DaprConsumer(endpoint, processor);
+ }
+
+ @Test
+ void testConsumer() throws Exception {
+ consumer.doStart();
+
+ verify(mockClient).subscribeToEvents(anyString(), anyString(), any(), any());
+
+ String payload = "testBody";
+ String pubSubName = "myPubSub";
+ String topic = "myTopic";
+ String id = "myId";
+ String ver = "myVer";
+ String contentType = "myContentType";
+ OffsetDateTime time = OffsetDateTime.now();
+ String traceParent = "myTrace";
+ String traceState = "myState";
+
+ CloudEvent<byte[]> cloudEvent = mock(CloudEvent.class);
+ when(cloudEvent.getData()).thenReturn(payload.getBytes());
+ when(cloudEvent.getPubsubName()).thenReturn(pubSubName);
+ when(cloudEvent.getTopic()).thenReturn(topic);
+ when(cloudEvent.getId()).thenReturn(id);
+ when(cloudEvent.getSpecversion()).thenReturn(ver);
+ when(cloudEvent.getBinaryData()).thenReturn(payload.getBytes());
+ when(cloudEvent.getDatacontenttype()).thenReturn(contentType);
+ when(cloudEvent.getTime()).thenReturn(time);
+ when(cloudEvent.getTraceParent()).thenReturn(traceParent);
+ when(cloudEvent.getTraceState()).thenReturn(traceState);
+
+ listenerCaptor.getValue().onEvent(cloudEvent).block();
+
+ verify(processor).process(exchangeCaptor.capture(), callbackCaptor.capture());
+
+ Exchange exchange = exchangeCaptor.getValue();
+ assertNotNull(exchange);
+
+ String body = new String(exchange.getIn().getBody(byte[].class), StandardCharsets.UTF_8);
+ assertEquals(payload, body);
+ assertEquals(pubSubName, exchange.getIn().getHeader(DaprConstants.PUBSUB_NAME));
+ assertEquals(topic, exchange.getIn().getHeader(DaprConstants.TOPIC));
+ assertEquals(id, exchange.getIn().getHeader(DaprConstants.ID));
+ assertEquals(ver, exchange.getIn().getHeader(DaprConstants.SPECIFIC_VERSION));
+ assertArrayEquals(payload.getBytes(), (byte[]) exchange.getIn().getHeader(DaprConstants.BINARY_DATA));
+ assertEquals(contentType, exchange.getIn().getHeader(DaprConstants.DATA_CONTENT_TYPE));
+ assertEquals(time, exchange.getIn().getHeader(DaprConstants.TIME));
+ assertEquals(traceParent, exchange.getIn().getHeader(DaprConstants.TRACE_PARENT));
+ assertEquals(traceState, exchange.getIn().getHeader(DaprConstants.TRACE_STATE));
+
+ consumer.doStop();
+ verify(mockSubscription).close();
+ verify(mockClient).close();
+ }
+}
diff --git a/components/camel-dapr/src/test/java/org/apache/camel/component/dapr/operations/DaprPubSubTest.java b/components/camel-dapr/src/test/java/org/apache/camel/component/dapr/operations/DaprPubSubTest.java
new file mode 100644
index 00000000000..123285f8309
--- /dev/null
+++ b/components/camel-dapr/src/test/java/org/apache/camel/component/dapr/operations/DaprPubSubTest.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.dapr.operations;
+
+import io.dapr.client.DaprClient;
+import io.dapr.client.domain.PublishEventRequest;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.dapr.DaprConfiguration;
+import org.apache.camel.component.dapr.DaprConfigurationOptionsProxy;
+import org.apache.camel.component.dapr.DaprOperation;
+import org.apache.camel.support.DefaultExchange;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+import reactor.core.publisher.Mono;
+
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
+@ExtendWith(MockitoExtension.class)
+public class DaprPubSubTest extends CamelTestSupport {
+
+ @Mock
+ private DaprClient client;
+
+ @Test
+ void testPubSub() throws Exception {
+ when(client.publishEvent(any(PublishEventRequest.class))).thenReturn(Mono.empty());
+
+ DaprConfiguration configuration = new DaprConfiguration();
+ configuration.setOperation(DaprOperation.pubSub);
+ configuration.setPubSubName("myPubSub");
+ configuration.setTopic("myTopic");
+ DaprConfigurationOptionsProxy configurationOptionsProxy = new DaprConfigurationOptionsProxy(configuration);
+
+ final Exchange exchange = new DefaultExchange(context);
+ exchange.getMessage().setBody("myBody");
+
+ final DaprPubSubHandler operation = new DaprPubSubHandler(configurationOptionsProxy);
+ final DaprOperationResponse operationResponse = operation.handle(exchange, client);
+
+ PublishEventRequest response = (PublishEventRequest) operationResponse.getBody();
+ assertNotNull(operationResponse);
+ assertEquals("myPubSub", response.getPubsubName());
+ assertEquals("myTopic", response.getTopic());
+ }
+
+ @Test
+ void testValidateConfiguration() {
+ DaprConfiguration configuration = new DaprConfiguration();
+ configuration.setOperation(DaprOperation.pubSub);
+ DaprConfigurationOptionsProxy configurationOptionsProxy = new DaprConfigurationOptionsProxy(configuration);
+
+ final Exchange exchange = new DefaultExchange(context);
+ final DaprPubSubHandler operation = new DaprPubSubHandler(configurationOptionsProxy);
+
+ // case 1: both pubSubName and topic empty
+ assertThrows(IllegalArgumentException.class, () -> operation.validateConfiguration(exchange));
+
+ // case 2: only pubSubName set
+ configuration.setPubSubName("myPubSub");
+ assertThrows(IllegalArgumentException.class, () -> operation.validateConfiguration(exchange));
+
+ // case 3: valid configuration
+ configuration.setTopic("myTopic");
+ assertDoesNotThrow(() -> operation.validateConfiguration(exchange));
+ }
+}
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DaprComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DaprComponentBuilderFactory.java
index 39c3f9a5445..53f033f1e78 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DaprComponentBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DaprComponentBuilderFactory.java
@@ -51,34 +51,126 @@ public interface DaprComponentBuilderFactory {
interface DaprComponentBuilder extends ComponentBuilder<DaprComponent> {
/**
- * Concurrency mode to use with state operations.
+ * The component configurations.
*
* The option is a:
- * <code>io.dapr.client.domain.StateOptions.Concurrency</code> type.
+ * <code>org.apache.camel.component.dapr.DaprConfiguration</code> type.
*
- * Group: producer
+ * Group: common
*
- * @param concurrency the value to set
+ * @param configuration the value to set
* @return the dsl builder
*/
- default DaprComponentBuilder concurrency(io.dapr.client.domain.StateOptions.Concurrency concurrency) {
- doSetProperty("concurrency", concurrency);
+ default DaprComponentBuilder configuration(org.apache.camel.component.dapr.DaprConfiguration configuration) {
+ doSetProperty("configuration", configuration);
return this;
}
/**
- * The component configurations.
+ * The contentType for the Pub/Sub component to use.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param contentType the value to set
+ * @return the dsl builder
+ */
+ default DaprComponentBuilder contentType(java.lang.String contentType) {
+ doSetProperty("contentType", contentType);
+ return this;
+ }
+
+ /**
+ * 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.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param pubSubName the value to set
+ * @return the dsl builder
+ */
+ default DaprComponentBuilder pubSubName(java.lang.String pubSubName) {
+ doSetProperty("pubSubName", pubSubName);
+ return this;
+ }
+
+ /**
+ * The name of the topic to subscribe to. The topic must exist in the
+ * Pub/Sub component configured under the given pubsubName.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param topic the value to set
+ * @return the dsl builder
+ */
+ default DaprComponentBuilder topic(java.lang.String topic) {
+ doSetProperty("topic", topic);
+ return this;
+ }
+
+
+ /**
+ * 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.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: consumer
+ *
+ * @param bridgeErrorHandler the value to set
+ * @return the dsl builder
+ */
+ default DaprComponentBuilder bridgeErrorHandler(boolean bridgeErrorHandler) {
+ doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
+ return this;
+ }
+
+ /**
+ * The client to consume messages by the consumer.
*
* The option is a:
- * <code>org.apache.camel.component.dapr.DaprConfiguration</code> type.
+ * <code>io.dapr.client.DaprPreviewClient</code> type.
+ *
+ * Group: consumer
+ *
+ * @param previewClient the value to set
+ * @return the dsl builder
+ */
+ default DaprComponentBuilder previewClient(io.dapr.client.DaprPreviewClient previewClient) {
+ doSetProperty("previewClient", previewClient);
+ return this;
+ }
+
+ /**
+ * Concurrency mode to use with state operations.
+ *
+ * The option is a:
+ * <code>io.dapr.client.domain.StateOptions.Concurrency</code> type.
*
* Group: producer
*
- * @param configuration the value to set
+ * @param concurrency the value to set
* @return the dsl builder
*/
- default DaprComponentBuilder configuration(org.apache.camel.component.dapr.DaprConfiguration configuration) {
- doSetProperty("configuration", configuration);
+ default DaprComponentBuilder concurrency(io.dapr.client.domain.StateOptions.Concurrency concurrency) {
+ doSetProperty("concurrency", concurrency);
return this;
}
@@ -298,8 +390,13 @@ public interface DaprComponentBuilderFactory {
String name,
Object value) {
switch (name) {
- case "concurrency": getOrCreateConfiguration((DaprComponent) component).setConcurrency((io.dapr.client.domain.StateOptions.Concurrency) value); return true;
case "configuration": ((DaprComponent) component).setConfiguration((org.apache.camel.component.dapr.DaprConfiguration) value); return true;
+ case "contentType": getOrCreateConfiguration((DaprComponent) component).setContentType((java.lang.String) value); return true;
+ case "pubSubName": getOrCreateConfiguration((DaprComponent) component).setPubSubName((java.lang.String) value); return true;
+ case "topic": getOrCreateConfiguration((DaprComponent) component).setTopic((java.lang.String) value); return true;
+ case "bridgeErrorHandler": ((DaprComponent) component).setBridgeErrorHandler((boolean) value); return true;
+ case "previewClient": getOrCreateConfiguration((DaprComponent) component).setPreviewClient((io.dapr.client.DaprPreviewClient) value); return true;
+ case "concurrency": getOrCreateConfiguration((DaprComponent) component).setConcurrency((io.dapr.client.domain.StateOptions.Concurrency) value); return true;
case "consistency": getOrCreateConfiguration((DaprComponent) component).setConsistency((io.dapr.client.domain.StateOptions.Consistency) value); return true;
case "eTag": getOrCreateConfiguration((DaprComponent) component).setETag((java.lang.String) value); return true;
case "httpExtension": getOrCreateConfiguration((DaprComponent) component).setHttpExtension((io.dapr.client.domain.HttpExtension) value); return true;
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DaprEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DaprEndpointBuilderFactory.java
index 7844151ab3b..e3f3abad20f 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DaprEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DaprEndpointBuilderFactory.java
@@ -35,15 +35,273 @@ import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
public interface DaprEndpointBuilderFactory {
/**
- * Builder for endpoint for the Dapr component.
+ * Builder for endpoint consumers for the Dapr component.
*/
- public interface DaprEndpointBuilder
+ public interface DaprEndpointConsumerBuilder
+ extends
+ EndpointConsumerBuilder {
+ default AdvancedDaprEndpointConsumerBuilder advanced() {
+ return (AdvancedDaprEndpointConsumerBuilder) this;
+ }
+ /**
+ * The contentType for the Pub/Sub component to use.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param contentType the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointConsumerBuilder contentType(String contentType) {
+ doSetProperty("contentType", contentType);
+ return this;
+ }
+ /**
+ * 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.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param pubSubName the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointConsumerBuilder pubSubName(String pubSubName) {
+ doSetProperty("pubSubName", pubSubName);
+ return this;
+ }
+ /**
+ * The name of the topic to subscribe to. The topic must exist in the
+ * Pub/Sub component configured under the given pubsubName.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param topic the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointConsumerBuilder topic(String topic) {
+ doSetProperty("topic", topic);
+ return this;
+ }
+ /**
+ * The client to consume messages by the consumer.
+ *
+ * The option is a: <code>io.dapr.client.DaprPreviewClient</code> type.
+ *
+ * Group: consumer
+ *
+ * @param previewClient the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointConsumerBuilder previewClient(io.dapr.client.DaprPreviewClient previewClient) {
+ doSetProperty("previewClient", previewClient);
+ return this;
+ }
+ /**
+ * The client to consume messages by the consumer.
+ *
+ * The option will be converted to a
+ * <code>io.dapr.client.DaprPreviewClient</code> type.
+ *
+ * Group: consumer
+ *
+ * @param previewClient the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointConsumerBuilder previewClient(String previewClient) {
+ doSetProperty("previewClient", previewClient);
+ return this;
+ }
+ }
+
+ /**
+ * Advanced builder for endpoint consumers for the Dapr component.
+ */
+ public interface AdvancedDaprEndpointConsumerBuilder
+ extends
+ EndpointConsumerBuilder {
+ default DaprEndpointConsumerBuilder basic() {
+ return (DaprEndpointConsumerBuilder) this;
+ }
+ /**
+ * 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.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: consumer (advanced)
+ *
+ * @param bridgeErrorHandler the value to set
+ * @return the dsl builder
+ */
+ default AdvancedDaprEndpointConsumerBuilder bridgeErrorHandler(boolean bridgeErrorHandler) {
+ doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
+ return this;
+ }
+ /**
+ * 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.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: consumer (advanced)
+ *
+ * @param bridgeErrorHandler the value to set
+ * @return the dsl builder
+ */
+ default AdvancedDaprEndpointConsumerBuilder bridgeErrorHandler(String bridgeErrorHandler) {
+ doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
+ return this;
+ }
+ /**
+ * To let the consumer use a custom ExceptionHandler. Notice if the
+ * option bridgeErrorHandler is enabled then this option is not in use.
+ * By default the consumer will deal with exceptions, that will be
+ * logged at WARN or ERROR level and ignored.
+ *
+ * The option is a: <code>org.apache.camel.spi.ExceptionHandler</code>
+ * type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exceptionHandler the value to set
+ * @return the dsl builder
+ */
+ default AdvancedDaprEndpointConsumerBuilder exceptionHandler(org.apache.camel.spi.ExceptionHandler exceptionHandler) {
+ doSetProperty("exceptionHandler", exceptionHandler);
+ return this;
+ }
+ /**
+ * To let the consumer use a custom ExceptionHandler. Notice if the
+ * option bridgeErrorHandler is enabled then this option is not in use.
+ * By default the consumer will deal with exceptions, that will be
+ * logged at WARN or ERROR level and ignored.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.spi.ExceptionHandler</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exceptionHandler the value to set
+ * @return the dsl builder
+ */
+ default AdvancedDaprEndpointConsumerBuilder exceptionHandler(String exceptionHandler) {
+ doSetProperty("exceptionHandler", exceptionHandler);
+ return this;
+ }
+ /**
+ * Sets the exchange pattern when the consumer creates an exchange.
+ *
+ * The option is a: <code>org.apache.camel.ExchangePattern</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exchangePattern the value to set
+ * @return the dsl builder
+ */
+ default AdvancedDaprEndpointConsumerBuilder exchangePattern(org.apache.camel.ExchangePattern exchangePattern) {
+ doSetProperty("exchangePattern", exchangePattern);
+ return this;
+ }
+ /**
+ * Sets the exchange pattern when the consumer creates an exchange.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.ExchangePattern</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exchangePattern the value to set
+ * @return the dsl builder
+ */
+ default AdvancedDaprEndpointConsumerBuilder exchangePattern(String exchangePattern) {
+ doSetProperty("exchangePattern", exchangePattern);
+ return this;
+ }
+ }
+
+ /**
+ * Builder for endpoint producers for the Dapr component.
+ */
+ public interface DaprEndpointProducerBuilder
extends
EndpointProducerBuilder {
- default AdvancedDaprEndpointBuilder advanced() {
- return (AdvancedDaprEndpointBuilder) this;
+ default AdvancedDaprEndpointProducerBuilder advanced() {
+ return (AdvancedDaprEndpointProducerBuilder) this;
}
+ /**
+ * The contentType for the Pub/Sub component to use.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param contentType the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointProducerBuilder contentType(String contentType) {
+ doSetProperty("contentType", contentType);
+ return this;
+ }
+ /**
+ * 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.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param pubSubName the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointProducerBuilder pubSubName(String pubSubName) {
+ doSetProperty("pubSubName", pubSubName);
+ return this;
+ }
+ /**
+ * The name of the topic to subscribe to. The topic must exist in the
+ * Pub/Sub component configured under the given pubsubName.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param topic the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointProducerBuilder topic(String topic) {
+ doSetProperty("topic", topic);
+ return this;
+ }
/**
* Concurrency mode to use with state operations.
*
@@ -55,7 +313,7 @@ public interface DaprEndpointBuilderFactory {
* @param concurrency the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder concurrency(io.dapr.client.domain.StateOptions.Concurrency concurrency) {
+ default DaprEndpointProducerBuilder concurrency(io.dapr.client.domain.StateOptions.Concurrency concurrency) {
doSetProperty("concurrency", concurrency);
return this;
}
@@ -70,7 +328,7 @@ public interface DaprEndpointBuilderFactory {
* @param concurrency the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder concurrency(String concurrency) {
+ default DaprEndpointProducerBuilder concurrency(String concurrency) {
doSetProperty("concurrency", concurrency);
return this;
}
@@ -85,7 +343,7 @@ public interface DaprEndpointBuilderFactory {
* @param consistency the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder consistency(io.dapr.client.domain.StateOptions.Consistency consistency) {
+ default DaprEndpointProducerBuilder consistency(io.dapr.client.domain.StateOptions.Consistency consistency) {
doSetProperty("consistency", consistency);
return this;
}
@@ -100,7 +358,7 @@ public interface DaprEndpointBuilderFactory {
* @param consistency the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder consistency(String consistency) {
+ default DaprEndpointProducerBuilder consistency(String consistency) {
doSetProperty("consistency", consistency);
return this;
}
@@ -115,7 +373,7 @@ public interface DaprEndpointBuilderFactory {
* @param eTag the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder eTag(String eTag) {
+ default DaprEndpointProducerBuilder eTag(String eTag) {
doSetProperty("eTag", eTag);
return this;
}
@@ -132,7 +390,7 @@ public interface DaprEndpointBuilderFactory {
* @param httpExtension the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder httpExtension(io.dapr.client.domain.HttpExtension httpExtension) {
+ default DaprEndpointProducerBuilder httpExtension(io.dapr.client.domain.HttpExtension httpExtension) {
doSetProperty("httpExtension", httpExtension);
return this;
}
@@ -149,7 +407,7 @@ public interface DaprEndpointBuilderFactory {
* @param httpExtension the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder httpExtension(String httpExtension) {
+ default DaprEndpointProducerBuilder httpExtension(String httpExtension) {
doSetProperty("httpExtension", httpExtension);
return this;
}
@@ -164,7 +422,7 @@ public interface DaprEndpointBuilderFactory {
* @param key the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder key(String key) {
+ default DaprEndpointProducerBuilder key(String key) {
doSetProperty("key", key);
return this;
}
@@ -178,7 +436,7 @@ public interface DaprEndpointBuilderFactory {
* @param methodToInvoke the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder methodToInvoke(String methodToInvoke) {
+ default DaprEndpointProducerBuilder methodToInvoke(String methodToInvoke) {
doSetProperty("methodToInvoke", methodToInvoke);
return this;
}
@@ -193,7 +451,7 @@ public interface DaprEndpointBuilderFactory {
* @param serviceToInvoke the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder serviceToInvoke(String serviceToInvoke) {
+ default DaprEndpointProducerBuilder serviceToInvoke(String serviceToInvoke) {
doSetProperty("serviceToInvoke", serviceToInvoke);
return this;
}
@@ -210,7 +468,7 @@ public interface DaprEndpointBuilderFactory {
* @param stateOperation the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder stateOperation(org.apache.camel.component.dapr.StateOperation stateOperation) {
+ default DaprEndpointProducerBuilder stateOperation(org.apache.camel.component.dapr.StateOperation stateOperation) {
doSetProperty("stateOperation", stateOperation);
return this;
}
@@ -227,7 +485,7 @@ public interface DaprEndpointBuilderFactory {
* @param stateOperation the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder stateOperation(String stateOperation) {
+ default DaprEndpointProducerBuilder stateOperation(String stateOperation) {
doSetProperty("stateOperation", stateOperation);
return this;
}
@@ -242,7 +500,7 @@ public interface DaprEndpointBuilderFactory {
* @param stateStore the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder stateStore(String stateStore) {
+ default DaprEndpointProducerBuilder stateStore(String stateStore) {
doSetProperty("stateStore", stateStore);
return this;
}
@@ -257,20 +515,18 @@ public interface DaprEndpointBuilderFactory {
* @param verb the value to set
* @return the dsl builder
*/
- default DaprEndpointBuilder verb(String verb) {
+ default DaprEndpointProducerBuilder verb(String verb) {
doSetProperty("verb", verb);
return this;
}
}
/**
- * Advanced builder for endpoint for the Dapr component.
+ * Advanced builder for endpoint producers for the Dapr component.
*/
- public interface AdvancedDaprEndpointBuilder
- extends
- EndpointProducerBuilder {
- default DaprEndpointBuilder basic() {
- return (DaprEndpointBuilder) this;
+ public interface AdvancedDaprEndpointProducerBuilder extends EndpointProducerBuilder {
+ default DaprEndpointProducerBuilder basic() {
+ return (DaprEndpointProducerBuilder) this;
}
/**
@@ -292,7 +548,7 @@ public interface DaprEndpointBuilderFactory {
* @param lazyStartProducer the value to set
* @return the dsl builder
*/
- default AdvancedDaprEndpointBuilder lazyStartProducer(boolean lazyStartProducer) {
+ default AdvancedDaprEndpointProducerBuilder lazyStartProducer(boolean lazyStartProducer) {
doSetProperty("lazyStartProducer", lazyStartProducer);
return this;
}
@@ -315,12 +571,83 @@ public interface DaprEndpointBuilderFactory {
* @param lazyStartProducer the value to set
* @return the dsl builder
*/
- default AdvancedDaprEndpointBuilder lazyStartProducer(String lazyStartProducer) {
+ default AdvancedDaprEndpointProducerBuilder lazyStartProducer(String lazyStartProducer) {
doSetProperty("lazyStartProducer", lazyStartProducer);
return this;
}
}
+ /**
+ * Builder for endpoint for the Dapr component.
+ */
+ public interface DaprEndpointBuilder
+ extends
+ DaprEndpointConsumerBuilder,
+ DaprEndpointProducerBuilder {
+ default AdvancedDaprEndpointBuilder advanced() {
+ return (AdvancedDaprEndpointBuilder) this;
+ }
+
+ /**
+ * The contentType for the Pub/Sub component to use.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param contentType the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointBuilder contentType(String contentType) {
+ doSetProperty("contentType", contentType);
+ return this;
+ }
+ /**
+ * 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.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param pubSubName the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointBuilder pubSubName(String pubSubName) {
+ doSetProperty("pubSubName", pubSubName);
+ return this;
+ }
+ /**
+ * The name of the topic to subscribe to. The topic must exist in the
+ * Pub/Sub component configured under the given pubsubName.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: common
+ *
+ * @param topic the value to set
+ * @return the dsl builder
+ */
+ default DaprEndpointBuilder topic(String topic) {
+ doSetProperty("topic", topic);
+ return this;
+ }
+ }
+
+ /**
+ * Advanced builder for endpoint for the Dapr component.
+ */
+ public interface AdvancedDaprEndpointBuilder
+ extends
+ AdvancedDaprEndpointConsumerBuilder,
+ AdvancedDaprEndpointProducerBuilder {
+ default DaprEndpointBuilder basic() {
+ return (DaprEndpointBuilder) this;
+ }
+
+ }
+
public interface DaprBuilders {
/**
* Dapr (camel-dapr)
@@ -590,6 +917,158 @@ public interface DaprEndpointBuilderFactory {
public String daprTransactions() {
return "CamelDaprTransactions";
}
+ /**
+ * 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.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: common
+ *
+ * @return the name of the header {@code DaprPubSubName}.
+ */
+ public String daprPubSubName() {
+ return "CamelDaprPubSubName";
+ }
+ /**
+ * The name of the topic to subscribe to. The topic must exist in the
+ * Pub/Sub component configured under the given pubsubName.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: common
+ *
+ * @return the name of the header {@code DaprTopic}.
+ */
+ public String daprTopic() {
+ return "CamelDaprTopic";
+ }
+ /**
+ * The content type for the Pub/Sub component to use.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: common
+ *
+ * @return the name of the header {@code DaprContentType}.
+ */
+ public String daprContentType() {
+ return "CamelDaprContentType";
+ }
+ /**
+ * Gets the unique identifier for the event, used to distinguish it from
+ * other events.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: consumer
+ *
+ * @return the name of the header {@code DaprID}.
+ */
+ public String daprID() {
+ return "CamelDaprID";
+ }
+ /**
+ * Gets the origin of the event, typically a URI indicating the
+ * component or service that generated the event.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: consumer
+ *
+ * @return the name of the header {@code DaprSource}.
+ */
+ public String daprSource() {
+ return "CamelDaprSource";
+ }
+ /**
+ * Gets the string indicating the type of cloud event.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: consumer
+ *
+ * @return the name of the header {@code DaprType}.
+ */
+ public String daprType() {
+ return "CamelDaprType";
+ }
+ /**
+ * Gets the version of the CloudEvents specification that the event
+ * conforms to.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: consumer
+ *
+ * @return the name of the header {@code DaprSpecificVersion}.
+ */
+ public String daprSpecificVersion() {
+ return "CamelDaprSpecificVersion";
+ }
+ /**
+ * Gets the content type of the event data.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: consumer
+ *
+ * @return the name of the header {@code DaprDataContentType}.
+ */
+ public String daprDataContentType() {
+ return "CamelDaprDataContentType";
+ }
+ /**
+ * Gets the raw binary data payload of the event, if present (for events
+ * where data_base64 is used instead of data).
+ *
+ * The option is a: {@code byte[]} type.
+ *
+ * Group: consumer
+ *
+ * @return the name of the header {@code DaprBinaryData}.
+ */
+ public String daprBinaryData() {
+ return "CamelDaprBinaryData";
+ }
+ /**
+ * Gets the timestamp of when the event occurred.
+ *
+ * The option is a: {@code OffsetDateTime} type.
+ *
+ * Group: consumer
+ *
+ * @return the name of the header {@code DaprTime}.
+ */
+ public String daprTime() {
+ return "CamelDaprTime";
+ }
+ /**
+ * Gets tracing info for following the event across services (includes
+ * trace ID and span ID).
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: consumer
+ *
+ * @return the name of the header {@code DaprTraceParent}.
+ */
+ public String daprTraceParent() {
+ return "CamelDaprTraceParent";
+ }
+ /**
+ * Gets additional vendor-specific trace context.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: consumer
+ *
+ * @return the name of the header {@code DaprTraceState}.
+ */
+ public String daprTraceState() {
+ return "CamelDaprTraceState";
+ }
}
static DaprEndpointBuilder endpointBuilder(String componentName, String path) {
class DaprEndpointBuilderImpl extends AbstractEndpointBuilder implements DaprEndpointBuilder, AdvancedDaprEndpointBuilder {