diff --git a/pubsub/gcp/pubsub/metadata.go b/pubsub/gcp/pubsub/metadata.go index 549c1b61f..7c88af06e 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 000000000..235aa13ec --- /dev/null +++ b/pubsub/gcp/pubsub/metadata.yaml @@ -0,0 +1,63 @@ +# 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 as well, "maxDeliveryAttempts" is the maximum number of attempts before messages are moved to the dead-letter queue. + type: number + default: '5' + example: '5'