This is an automated email from the ASF dual-hosted git repository.
fmariani pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git
The following commit(s) were added to refs/heads/main by this push:
new 812ccdc4 chore: fix arangodb and kafka-offsetrepository examples
812ccdc4 is described below
commit 812ccdc4de8404700052121041f211867dc7c016
Author: Croway <[email protected]>
AuthorDate: Mon Apr 13 11:16:10 2026 +0200
chore: fix arangodb and kafka-offsetrepository examples
- arangodb: add explicit host/port config required since driver 7.24+
and use BaseDocument instead of String for FIND_DOCUMENT_BY_KEY result
- kafka-offsetrepository: add recordMetadata=true since default changed
---
.../java/org/apache/camel/example/springboot/arangodb/CamelRoute.java | 3 ++-
arangodb/src/main/resources/application.properties | 2 ++
kafka-offsetrepository/src/main/resources/spring/camel-context.xml | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git
a/arangodb/src/main/java/org/apache/camel/example/springboot/arangodb/CamelRoute.java
b/arangodb/src/main/java/org/apache/camel/example/springboot/arangodb/CamelRoute.java
index a6933b08..cc6f3f3a 100644
---
a/arangodb/src/main/java/org/apache/camel/example/springboot/arangodb/CamelRoute.java
+++
b/arangodb/src/main/java/org/apache/camel/example/springboot/arangodb/CamelRoute.java
@@ -16,6 +16,7 @@
*/
package org.apache.camel.example.springboot.arangodb;
+import com.arangodb.entity.BaseDocument;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.arangodb.ArangoDbConstants;
import org.springframework.stereotype.Component;
@@ -30,7 +31,7 @@ public class CamelRoute extends RouteBuilder {
.bean(MyBeanService.class, "createDocument")
.to("arangodb:myDatabase?operation=SAVE_DOCUMENT")
.bean(MyBeanService.class, "readDocument")
-
.setHeader(ArangoDbConstants.RESULT_CLASS_TYPE).constant(String.class)
+
.setHeader(ArangoDbConstants.RESULT_CLASS_TYPE).constant(BaseDocument.class)
.to("arangodb:myDatabase?operation=FIND_DOCUMENT_BY_KEY")
.log("Received body: ${body}");
}
diff --git a/arangodb/src/main/resources/application.properties
b/arangodb/src/main/resources/application.properties
index b20fe70e..504d5f3e 100644
--- a/arangodb/src/main/resources/application.properties
+++ b/arangodb/src/main/resources/application.properties
@@ -16,6 +16,8 @@
## ---------------------------------------------------------------------------
camel.main.name=ArangoDB
camel.main.run-controller=true
+camel.component.arangodb.host=localhost
+camel.component.arangodb.port=8529
camel.component.arangodb.documentCollection=myCollection
camel.component.arangodb.user=root
camel.component.arangodb.password=password
diff --git a/kafka-offsetrepository/src/main/resources/spring/camel-context.xml
b/kafka-offsetrepository/src/main/resources/spring/camel-context.xml
index 6ddc59c5..d52e67f7 100644
--- a/kafka-offsetrepository/src/main/resources/spring/camel-context.xml
+++ b/kafka-offsetrepository/src/main/resources/spring/camel-context.xml
@@ -57,7 +57,7 @@
<setBody id="route-setBody-1">
<simple>This is first producer: ${id}</simple>
</setBody>
- <to id="_kafka1"
uri="kafka:{{producer.topic}}?partitionKey={{partitionValue}}&key=${id}"/>
+ <to id="_kafka1"
uri="kafka:{{producer.topic}}?partitionKey={{partitionValue}}&key=${id}&recordMetadata=true"/>
<log id="route-log-producer-1" message="producer >>> ${body}"/>
<bean id="_bean1" ref="kafkaProcessor"/>
</route>