Skip to content

Commit 7fa0c89

Browse files
committed
CAMEL-15088: camel-dapr - add Dapr component, invokeService operation
1 parent 196b6bf commit 7fa0c89

File tree

51 files changed

+2427
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2427
-0
lines changed

bom/camel-bom/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,11 @@
602602
<artifactId>camel-cxf-transport</artifactId>
603603
<version>4.12.0-SNAPSHOT</version>
604604
</dependency>
605+
<dependency>
606+
<groupId>org.apache.camel</groupId>
607+
<artifactId>camel-dapr</artifactId>
608+
<version>4.12.0-SNAPSHOT</version>
609+
</dependency>
605610
<dependency>
606611
<groupId>org.apache.camel</groupId>
607612
<artifactId>camel-dataformat</artifactId>

catalog/camel-allcomponents/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,11 @@
496496
<artifactId>camel-cxf-transport</artifactId>
497497
<version>${project.version}</version>
498498
</dependency>
499+
<dependency>
500+
<groupId>org.apache.camel</groupId>
501+
<artifactId>camel-dapr</artifactId>
502+
<version>${project.version}</version>
503+
</dependency>
499504
<dependency>
500505
<groupId>org.apache.camel</groupId>
501506
<artifactId>camel-dataformat</artifactId>

catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ cron
7373
crypto
7474
cxf
7575
cxfrs
76+
dapr
7677
dataformat
7778
dataset
7879
dataset-test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"component": {
3+
"kind": "component",
4+
"name": "dapr",
5+
"title": "Dapr",
6+
"description": "Dapr component which interfaces with Dapr Building Blocks.",
7+
"deprecated": false,
8+
"firstVersion": "4.11.0",
9+
"label": "cloud,saas",
10+
"javaType": "org.apache.camel.component.dapr.DaprComponent",
11+
"supportLevel": "Preview",
12+
"groupId": "org.apache.camel",
13+
"artifactId": "camel-dapr",
14+
"version": "4.12.0-SNAPSHOT",
15+
"scheme": "dapr",
16+
"extendsScheme": "",
17+
"syntax": "dapr:operation",
18+
"async": false,
19+
"api": false,
20+
"consumerOnly": false,
21+
"producerOnly": false,
22+
"lenientProperties": false,
23+
"browsable": false,
24+
"remote": true
25+
},
26+
"componentProperties": {
27+
"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" },
28+
"bridgeErrorHandler": { "index": 1, "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 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." },
29+
"httpExtension": { "index": 2, "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 GET, POST, PUT, DELETE, etc. Creates a minimal HttpExtension with no headers or query params. Takes precedence over verb" },
30+
"lazyStartProducer": { "index": 3, "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 during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." },
31+
"methodToInvoke": { "index": 4, "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" },
32+
"serviceToInvoke": { "index": 5, "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" },
33+
"verb": { "index": 6, "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" },
34+
"autowiredEnabled": { "index": 7, "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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }
35+
},
36+
"headers": {
37+
"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" },
38+
"CamelDaprMethodToInvoke": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the method or route to invoke on the target service", "constantName": "org.apache.camel.component.dapr.DaprConstants#METHOD_TO_INVOKE" },
39+
"CamelDaprVerb": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The HTTP verb to use for service invocation", "constantName": "org.apache.camel.component.dapr.DaprConstants#VERB" },
40+
"CamelDaprQueryParameters": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Map<String, List<String>>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The query parameters for HTTP requests", "constantName": "org.apache.camel.component.dapr.DaprConstants#QUERY_PARAMETERS" },
41+
"CamelDaprHttpHeaders": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Map<String, String>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The headers for HTTP requests", "constantName": "org.apache.camel.component.dapr.DaprConstants#HTTP_HEADERS" },
42+
"CamelDaprHttpExtension": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "HttpExtension", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The HttpExtension object for service invocation. Takes precedence over verb", "constantName": "org.apache.camel.component.dapr.DaprConstants#HTTP_EXTENSION" }
43+
},
44+
"properties": {
45+
"operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "object", "javaType": "org.apache.camel.component.dapr.DaprOperation", "enum": [ "invokeService" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dapr.DaprConfiguration", "configurationField": "configuration", "description": "The Dapr building block operation to perform with this component" },
46+
"bridgeErrorHandler": { "index": 1, "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 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." },
47+
"exceptionHandler": { "index": 2, "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 default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." },
48+
"exchangePattern": { "index": 3, "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." },
49+
"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 like GET, POST, PUT, DELETE, etc. Creates a minimal HttpExtension with no headers or query params. Takes precedence over verb" },
50+
"methodToInvoke": { "index": 5, "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" },
51+
"serviceToInvoke": { "index": 6, "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" },
52+
"verb": { "index": 7, "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" },
53+
"lazyStartProducer": { "index": 8, "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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }
54+
}
55+
}

catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cluster
88
componentdsl
99
console
1010
csimple-joor
11+
dapr
1112
debug
1213
dsl-modeline
1314
elytron
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"other": {
3+
"kind": "other",
4+
"name": "dapr",
5+
"title": "Dapr",
6+
"description": "Camel Dapr component",
7+
"deprecated": false,
8+
"firstVersion": "4.11.0",
9+
"supportLevel": "Preview",
10+
"groupId": "org.apache.camel",
11+
"artifactId": "camel-dapr",
12+
"version": "4.12.0-SNAPSHOT"
13+
}
14+
}

components/camel-dapr/pom.xml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one or more
5+
contributor license agreements. See the NOTICE file distributed with
6+
this work for additional information regarding copyright ownership.
7+
The ASF licenses this file to You under the Apache License, Version 2.0
8+
(the "License"); you may not use this file except in compliance with
9+
the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22+
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<artifactId>components</artifactId>
27+
<groupId>org.apache.camel</groupId>
28+
<version>4.12.0-SNAPSHOT</version>
29+
</parent>
30+
31+
<artifactId>camel-dapr</artifactId>
32+
<packaging>jar</packaging>
33+
<name>Camel :: Dapr</name>
34+
<description>Camel Dapr component</description>
35+
36+
<properties>
37+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
38+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
39+
<firstVersion>4.11.0</firstVersion>
40+
</properties>
41+
42+
<dependencies>
43+
44+
<!-- camel -->
45+
<dependency>
46+
<groupId>org.apache.camel</groupId>
47+
<artifactId>camel-support</artifactId>
48+
</dependency>
49+
50+
<!-- dapr -->
51+
<dependency>
52+
<groupId>io.dapr</groupId>
53+
<artifactId>dapr-sdk</artifactId>
54+
<version>1.13.1</version>
55+
</dependency>
56+
57+
<!-- logging -->
58+
<dependency>
59+
<groupId>org.apache.logging.log4j</groupId>
60+
<artifactId>log4j-slf4j2-impl</artifactId>
61+
<version>2.21.1</version>
62+
<scope>test</scope>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.apache.logging.log4j</groupId>
66+
<artifactId>log4j-core</artifactId>
67+
<version>2.21.1</version>
68+
<scope>test</scope>
69+
</dependency>
70+
71+
<!-- for testing -->
72+
<dependency>
73+
<groupId>org.apache.camel</groupId>
74+
<artifactId>camel-test-junit5</artifactId>
75+
<scope>test</scope>
76+
</dependency>
77+
<dependency>
78+
<groupId>org.mockito</groupId>
79+
<artifactId>mockito-junit-jupiter</artifactId>
80+
<version>${mockito-version}</version>
81+
<scope>test</scope>
82+
</dependency>
83+
<dependency>
84+
<groupId>org.apache.commons</groupId>
85+
<artifactId>commons-lang3</artifactId>
86+
<scope>test</scope>
87+
</dependency>
88+
89+
</dependencies>
90+
91+
</project>

0 commit comments

Comments
 (0)