Skip to content

Google Pub/Sub Channel Binding v0.1.0

The Google Cloud Pub/Sub channel binding v0.1.0 defines how an AsyncAPI channel maps to a Google Cloud Pub/Sub Topic.

Overview

This binding object allows you to specify configuration for a Pub/Sub topic. Note that this version of the binding has a somewhat confusing structure that was improved in later versions.

Channel Properties

PropertyTypeRequiredDescription
bindingVersionstringNoBinding version (defaults to 0.1.0).
topicstringYesThe name of the topic.
labelsobjectNoA map of key-value pairs for organizing resources.
messageRetentionDurationstringNoThe minimum duration a message is retained.
messageStoragePolicyobjectNoPolicy for controlling where messages are stored.
schemaSettingsobjectYesSettings for a schema associated with the topic.

schemaSettings Object

PropertyTypeRequiredDescription
encodingstringYesThe encoding of messages. Can be json or binary.
namestringYesThe full resource name of the schema.

Example

yaml
channels:
  user-creation-events:
    bindings:
      googlepubsub:
        bindingVersion: '0.1.0'
        topic: 'user-created-topic'
        schemaSettings:
          encoding: 'json'
          name: 'projects/my-gcp-project/schemas/UserCreatedEvent'

Changelog

Version 0.1.0

  • Initial release.
  • Note: This version included both topic and schemaSettings at the same level, which was clarified in v0.2.0. The topic string should be the channel address in modern usage.