Dropbox Source
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Stable"
Consume Files from Dropbox.
Configuration Options
The following table summarizes the configuration options available for the dropbox-source
Kamelet:
Property | Name | Description | Type | Default | Example |
---|---|---|---|---|---|
Dropbox Access Token | Required The access Token to use to access Dropbox. | string | |||
Client Identifier | Required Dropbox App client Identifier. | string | |||
Period between Polls | Required The interval between fetches to the Dropbox remote path in milliseconds. | integer | 10000 | ||
Queries | Required A space-separated list of sub-strings to search for. A file matches only if it contains all the sub-strings. If this option is not set, all files will be matched. | string | |||
Remote Path | Required Original file or folder to work with. | string |
Dependencies
At runtime, the dropbox-source
Kamelet relies upon the presence of the following dependencies:
-
camel:dropbox
-
camel:kamelet
-
camel:core
-
camel:jsonpath
-
camel:timer
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:timer-source"
parameters:
period: 10000
message: 'test'
steps:
- to:
uri: "kamelet:log-sink"
You can now run it directly through the following command
camel run route.yaml
Camel K Environment Usage
This section describes how you can use the dropbox-source
.
Knative source
You can use the dropbox-source
Kamelet as a Knative source by binding it to a Knative object.
apiVersion: camel.apache.org/v1
kind: KameletBinding
metadata:
name: dropbox-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: dropbox-source
properties:
accessToken: The Dropbox Access Token
clientIdentifier: The Client Identifier
period: The Period between Polls
query: The Queries
remotePath: The Remote Path
sink:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
Prerequisite
You have Camel K installed on the cluster.
Procedure for using the cluster CLI
-
Save the
dropbox-source-binding.yaml
file to your local drive, and then edit it as needed for your configuration. -
Run the source by using the following command:
kubectl apply -f dropbox-source-binding.yaml
Procedure for using the Kamel CLI
Configure and run the source by using the following command:
kamel bind channel:mychannel -p "source.accessToken=The Dropbox Access Token" -p "source.clientIdentifier=The Client Identifier" -p "source.period=The Period between Polls" -p "source.query=The Queries" -p "source.remotePath=The Remote Path" dropbox-source
This command creates the KameletBinding in the current namespace on the cluster.
Kafka source
You can use the dropbox-source
Kamelet as a Kafka source by binding it to a Kafka topic.
apiVersion: camel.apache.org/v1
kind: KameletBinding
metadata:
name: dropbox-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: dropbox-source
properties:
accessToken: The Dropbox Access Token
clientIdentifier: The Client Identifier
period: The Period between Polls
query: The Queries
remotePath: The Remote Path
sink:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
Prerequisites
-
You’ve installed Strimzi.
-
You’ve created a topic named
my-topic
in the current namespace. -
You have Camel K installed on the cluster.
Procedure for using the cluster CLI
-
Save the
dropbox-source-binding.yaml
file to your local drive, and then edit it as needed for your configuration. -
Run the source by using the following command:
kubectl apply -f dropbox-source-binding.yaml
Procedure for using the Kamel CLI
Configure and run the source by using the following command:
kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic -p "source.accessToken=The Dropbox Access Token" -p "source.clientIdentifier=The Client Identifier" -p "source.period=The Period between Polls" -p "source.query=The Queries" -p "source.remotePath=The Remote Path" dropbox-source
This command creates the KameletBinding in the current namespace on the cluster.