Skip to content

Commit

Permalink
feat: adapt googlepubsub bindings to v3
Browse files Browse the repository at this point in the history
Changes from v2 to v3:

* The `topic` property for the Channel Binding Object is no more and is now
  provided via the native `address` property of the Channel Object
* Protobuf support now uses the native support by providing the Protobuf
  definition as an inline string of the `schema` property of the Message
  Object and the `schemaFormat` now has valid values for Protobuf 2 and 3
  • Loading branch information
whitlockjc committed Jul 27, 2023
1 parent 4841cf5 commit 9060b2d
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions googlepubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Field Name | Type | Description
`messageRetentionDuration`|String|Indicates the minimum duration to retain a message after it is published to the topic _(Must be a valid [Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration).)_
`messageStoragePolicy`|[Message Storage Policy Object](#message-storage-policy-object)|Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored
`schemaSettings`|[Schema Settings Object](#schema-settings-object)|Settings for validating messages published against a schema
`topic`|String|The Google Cloud Pub/Sub Topic name

<a name="message-storage-policy-object"></a>

Expand Down Expand Up @@ -59,17 +58,17 @@ Field Name | Type | Description
# ...
channels:
topic-avro-schema:
address: projects/your-project/topics/topic-avro-schema
bindings:
googlepubsub:
topic: projects/your-project/topics/topic-avro-schema
schemaSettings:
encoding: json
name: projects/your-project/schemas/message-avro
# ...
topic-proto-schema:
address: projects/your-project/topics/topic-proto-schema
bindings:
googlepubsub:
topic: projects/your-project/topics/topic-proto-schema
messageRetentionDuration: 86400s
messageStoragePolicy:
allowedPersistenceRegions:
Expand Down Expand Up @@ -139,12 +138,13 @@ components:
contentType: application/json
name: MessageAvro
payload:
fields:
- name: message
type: string
name: Message
type: record
schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0
schema:
fields:
- name: message
type: string
name: Message
type: record
schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0
messageProto:
bindings:
googlepubsub:
Expand All @@ -153,7 +153,14 @@ components:
type: protobuf
contentType: application/octet-stream
name: MessageProto
payload: true
payload:
schema: |
syntax = "proto3";
message Message {
required string message = 1;
}
schemaFormat: application/vnd.google.protobuf;version=3
# ...
```

Expand Down

0 comments on commit 9060b2d

Please sign in to comment.