Google Storage Event-based Source
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Preview"
Receive data from Google Pubsub reporting events related to a Google Storage bucket.
Configuration Options
The following table summarizes the configuration options available for the google-storage-event-based-source
Kamelet:
Property | Name | Description | Type | Default | Example |
---|---|---|---|---|---|
Bucket Name Or ARN | Required The Google Cloud Storage bucket name or Bucket Amazon Resource Name (ARN). | string | |||
Project Id | Required The Google Cloud Pub/Sub Project ID. | string | |||
Service Account Key | Required The service account key to use as credentials for the Pub/Sub publisher/subscriber. You must encode this value in base64. | binary | |||
Subscription Name | Required The subscription name. | string | |||
Concurrent Consumers | The number of parallel streams to consume from the subscription. | integer | 1 | ||
Get Object in Bucket | If | boolean | false | ||
Max Messages Per Poll | The maximum number of messages to receive from the server in a single API call. | integer | 1 | ||
Synchronous Pull | Specifies to synchronously pull batches of messages. | boolean | false |
Dependencies
At runtime, the google-storage-event-based-source
Kamelet relies upon the presence of the following dependencies:
-
camel:kamelet
-
camel:google-pubsub
-
camel:google-storage
-
camel:jackson
-
camel:core
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:google-storage-event-based-source"
parameters:
.
.
.
steps:
- to:
uri: "kamelet:log-sink"
You can now run it directly through the following command
camel run route.yaml
Google Storage Event-based Source Kamelet Description
Authentication methods
This Kamelet uses Service Account Key authentication to connect to Google Cloud Pub/Sub for receiving Google Storage bucket events. You need to provide:
-
A service account key encoded in base64 format
-
The Google Cloud Project ID
-
The subscription name configured to receive storage events
-
The bucket name or ARN for which events are monitored
Output format
The Kamelet receives data from Google Pub/Sub reporting events related to a Google Storage bucket and produces the event data in JSON format.
Configuration
The Kamelet requires the following parameters:
-
projectId
: The Google Cloud Pub/Sub Project ID -
subscriptionName
: The subscription name -
serviceAccountKey
: The service account key to use as credentials (must be base64 encoded) -
bucketNameOrArn
: The bucket name or ARN for which events are monitored
Optional parameters: - synchronousPull
: Specifies to synchronously pull batches of messages (default: false) - maxMessagesPerPoll
: The maximum number of messages to receive from the server in a single API call - concurrentConsumers
: The number of parallel streams to consume from the subscription
Usage example
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: google-storage-event-based-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: google-storage-event-based-source
properties:
projectId: "my-gcp-project"
subscriptionName: "storage-events-subscription"
serviceAccountKey: "{{service-account-key-base64}}"
bucketNameOrArn: "my-storage-bucket"
synchronousPull: true
maxMessagesPerPoll: 10
concurrentConsumers: 2
sink:
ref:
kind: Service
apiVersion: v1
name: my-service