From f7f297fe3bc8d3d76484c239483911771da1d1d5 Mon Sep 17 00:00:00 2001 From: robertojrojas Date: Sun, 6 Aug 2023 18:58:30 -0400 Subject: [PATCH] [GCP PubSub] Adds Component Metadata Schema Signed-off-by: robertojrojas --- pubsub/gcp/pubsub/metadata.go | 26 +++++++------- pubsub/gcp/pubsub/metadata.yaml | 64 +++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 pubsub/gcp/pubsub/metadata.yaml diff --git a/pubsub/gcp/pubsub/metadata.go b/pubsub/gcp/pubsub/metadata.go index 549c1b61fc..7c88af06ec 100644 --- a/pubsub/gcp/pubsub/metadata.go +++ b/pubsub/gcp/pubsub/metadata.go @@ -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"` diff --git a/pubsub/gcp/pubsub/metadata.yaml b/pubsub/gcp/pubsub/metadata.yaml new file mode 100644 index 0000000000..0e38593a95 --- /dev/null +++ b/pubsub/gcp/pubsub/metadata.yaml @@ -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'