Couchbase Source
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Preview"
Poll a Couchbase bucket and emit the results.
Configuration Options
The following table summarizes the configuration options available for the couchbase-source Kamelet:
| Property | Name | Description | Type | Default | Example |
|---|---|---|---|---|---|
Bucket | Required The bucket to use. | string | |||
Hostname | Required The hostname to use. | string | |||
Protocol | Required The protocol to use. | string | |||
Connection String | The full Couchbase SDK connection string (e.g. couchbase://host:port). When set, it takes precedence over hostname extraction for the KV service port. | string | |||
Port | The port to use. | integer | 8091 | ||
Delay | The number of milliseconds between each poll. | integer | 500 | ||
Descending | Return the results in descending order. | boolean | false | ||
Design Document Name | The design document to query. Only used when useView is true. | string | beer | ||
Full Document | Emit the whole document rather than only the fields the query or view returns. | boolean | false | ||
Limit | The maximum number of documents to return per poll. A negative value means no limit. | integer | -1 | ||
Password | Password to connect to Couchbase. | string | |||
Skip | How many documents to skip before returning results. A negative value means none. | integer | -1 | ||
N1QL Statement | The N1QL query to run against the bucket on each poll. Used unless useView is true. The query runs in the bucket scope, so the keyspace is the collection - use _default for the default collection rather than the bucket name. It must also alias the document id as __id, because rows without that field are skipped. | string | SELECT META().id AS __id, * FROM _default | ||
Use View | Poll a MapReduce view instead of running the N1QL statement. | boolean | false | ||
Username | Username to connect to Couchbase. | string | |||
View Name | The view to query. Only used when useView is true. | string | brewery_beers |
Dependencies
At runtime, the couchbase-source Kamelet relies upon the presence of the following dependencies:
-
camel:core
-
camel:couchbase
-
camel:kamelet
Camel JBang usage
Prerequisites
-
You’ve installed JBang.
-
You have executed the following command:
jbang app install camel@apache/camel Supposing you have a file named route.yaml with this content:
- route:
from:
uri: "kamelet:couchbase-source"
parameters:
.
.
.
steps:
- to:
uri: "kamelet:log-sink" You can now run it directly through the following command
camel run route.yaml Couchbase Source Kamelet Description
Query Modes
The bucket is polled in one of two modes.
By default the N1QL statement in the statement property is run against the bucket on each poll. Set useView to true to poll a MapReduce view instead, selected with designDocumentName and viewName.
Writing the Statement
The statement runs in the bucket scope, so the keyspace is the collection rather than the bucket name - use _default for the default collection.
It must also alias the document id as __id, because the consumer skips any row without that field. A query that omits it produces a source that polls without emitting anything:
SELECT META().id AS __id, * FROM _default