Camel ArangoDB Component
For more details about ArangoDB, consult the ArangoDB web site.
ArangoDB is a multi-model database. But, at this moment, this component is only dedicated to the document model. ArangoDB is available as a Docker container: see https://www.arangodb.com/download-major/docker/
- Version 2.0: support for ArangoDB 3.1 or above (tested with 3.3.19)
mvn clean install
For the tests, start an ArangoDB server, e.g.
docker run -p 8529:8529 -e ARANGO_ROOT_PASSWORD=openSesame arangodb/arangodb:3.3.19
Add the dependency in your pom.xml
<dependency>
<groupId>io.millesabords.camel</groupId>
<artifactId>camel-arangodb</artifactId>
<version>1.0</version>
</dependency>
arangodb:configBean?database=databaseName&collection=collectionName&operation=operationName[&moreOptions...]
name | Default value | Description |
---|---|---|
database | none | Required. Name of the default database. |
collection | none | Name of the collection to which this endpoint will be bound. |
host | localhost | Hostname where ArangoDB is running. |
port | 8529 | Port of ArangoDB. |
operation | none | Operation to execute (insert, update, delete, get, aql_query). |
aql | none | AQL query to execute (if operation is aql_query). |
name | Description |
---|---|
_arango.operation | Operation to execute (insert, update, delete, get, aql_query). |
_arango.collection | Name of the collection to use by the producer. |
_arango.aql_query | AQL query to execute (if operation is aql_query). |
_arango.aql_query_vars | Variables to use with the AQL query. |
- Insert a user in a collection 'users' (the body must be a BaseDocument instance)
from("direct:insert_user")
.to("arangodb:config?database=testdb&collection=users&operation=insert")
.to("mock:result");
- Find a user (the body must be the document key of the user and you will find the document in the body)
from("direct:get_user")
.to("arangodb:config?database=testdb&collection=users&operation=get")
.to("mock:result");
- Delete a user (the body must be the document key)
from("direct:delete_user")
.to("arangodb:config?database=testdb&collection=users&operation=delete")
.to("mock:result");
- Log all the users
from("direct:log_users_bob")
.setHeader(ArangoDbConstants.ARANGO_AQL_QUERY_HEADER)
.constant("FOR u IN users FILTER u.name == @name RETURN u")
.setHeader(ArangoDbConstants.ARANGO_AQL_QUERY_VARS_HEADER)
.constant(new MapBuilder().put("name", "bob").get())
.to("arangodb:config?database=testdb&operation=aql_query")
.split(body())
.log("${body}")
.to("mock:result");
Feel free to send PRs to fix issues, add new features, etc. Any comments/questions/comments are welcome !