Skip to content

Commit

Permalink
[GCP PubSub] Adds Component Metadata Schema
Browse files Browse the repository at this point in the history
Signed-off-by: robertojrojas <[email protected]>
  • Loading branch information
robertojrojas committed Aug 6, 2023
1 parent 31ccb5f commit f7f297f
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 12 deletions.
26 changes: 14 additions & 12 deletions pubsub/gcp/pubsub/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@ package pubsub

// GCPPubSubMetaData pubsub metadata.
type metadata struct {
ConsumerID string `mapstructure:"consumerID"`
Type string `mapstructure:"type"`
IdentityProjectID string `mapstructure:"identityProjectID"`
ProjectID string `mapstructure:"projectID"`
PrivateKeyID string `mapstructure:"privateKeyID"`
PrivateKey string `mapstructure:"privateKey"`
ClientEmail string `mapstructure:"clientEmail"`
ClientID string `mapstructure:"clientID"`
AuthURI string `mapstructure:"authURI"`
TokenURI string `mapstructure:"tokenURI"`
AuthProviderCertURL string `mapstructure:"authProviderX509CertUrl"`
ClientCertURL string `mapstructure:"clientX509CertUrl"`
// Ignored by metadata parser because included in built-in authentication profile
ConsumerID string `mapstructure:"consumerID" mdignore:"true"`
Type string `mapstructure:"type" mdignore:"true"`
IdentityProjectID string `mapstructure:"identityProjectID" mdignore:"true"`
ProjectID string `mapstructure:"projectID" mdignore:"true"`
PrivateKeyID string `mapstructure:"privateKeyID" mdignore:"true"`
PrivateKey string `mapstructure:"privateKey" mdignore:"true"`
ClientEmail string `mapstructure:"clientEmail" mdignore:"true"`
ClientID string `mapstructure:"clientID" mdignore:"true"`
AuthURI string `mapstructure:"authURI" mdignore:"true"`
TokenURI string `mapstructure:"tokenURI" mdignore:"true"`
AuthProviderCertURL string `mapstructure:"authProviderX509CertUrl" mdignore:"true"`
ClientCertURL string `mapstructure:"clientX509CertUrl" mdignore:"true"`

DisableEntityManagement bool `mapstructure:"disableEntityManagement"`
EnableMessageOrdering bool `mapstructure:"enableMessageOrdering"`
MaxReconnectionAttempts int `mapstructure:"maxReconnectionAttempts"`
Expand Down
64 changes: 64 additions & 0 deletions pubsub/gcp/pubsub/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# yaml-language-server: $schema=../../../component-metadata-schema.json
schemaVersion: v1
type: pubsub
name: pubsub.gcp.pubsub
version: v1
status: stable
title: "GCP Pub/Sub"
urls:
- title: Reference
url: https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-gcp-pubsub/
capabilities: []
builtinAuthenticationProfiles:
- name: "gcp"
metadata:
- name: orderingKey
description: |
The key provided in the request. It’s used when enableMessageOrdering
is set to true to order messages based on such key.
type: string
example: “my-orderingkey”
- name: enableMessageOrdering
description: |
When set to "true", subscribed messages will be received in order,
depending on publishing and permissions configuration.
type: bool
default: 'false'
example: '"true", "false"'
- name: disableEntityManagement
description: |
When set to "true", topics and subscriptions do not get created automatically.
type: bool
default: 'false'
example: '"true", "false"'
- name: maxReconnectionAttempts
description: |
Defines the maximum number of reconnect attempts.
type: number
default: '30'
example: '30'
- name: connectionRecoveryInSec
description: |
Time in seconds to wait between connection recovery attempts.
type: number
default: '2'
example: '2'
- name: deadLetterTopic
description: |
Name of the GCP Pub/Sub Topic. This topic must exist before using this component.
type: string
example: "myapp-dlq"
- name: endpoint
description: |
GCP endpoint for the component to use. Only used for local development (for example)
with GCP Pub/Sub Emulator. The endpoint is unnecessary when running against the GCP production API.
type: string
example: "http://localhost:8085"
- name: maxDeliveryAttempts
description: |
Maximum number of attempts to deliver the message. If deadLetterTopic is specified,
maxDeliveryAttempts is the maximum number of attempts for failed processing of messages.
Once that number is reached, the message will be moved to the dead-letter topic.
type: number
default: '5'
example: '5'

0 comments on commit f7f297f

Please sign in to comment.