-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgoogle-pubsub-sample-2.6.yaml
108 lines (105 loc) · 3.53 KB
/
google-pubsub-sample-2.6.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# An AsyncAPI definition for Google Cloud Pub/Sub
# Google Cloud Pub/Sub Bindings docs:
# https://github.com/asyncapi/bindings/tree/master/googlepubsub
asyncapi: 2.6.0
info:
title: Google Cloud Pub/Sub Topology
description: AsyncAPI definition for Google Cloud Pub/Sub
version: 0.0.1
servers:
cloudPubSub:
url: '{cloudPubSubEndpoint}.googleapis.com'
description: The API for Cloud Pub/Sub.
protocol: googlepubsub
variables:
cloudPubSubEndpoint:
description: The Cloud Pub/Sub endpoint region.
# Default to the global endpoint
default: pubsub
# Or, restrict to only the following region-specific endpoints.
# enum:
# - us-central1
# - us-central2
channels:
topic-avro-schema:
bindings:
googlepubsub:
topic: projects/your-project/topics/topic-avro-schema
schemaSettings:
encoding: json
name: projects/your-project/schemas/message-avro
publish:
message:
$ref: '#/components/messages/messageAvro'
subscribe:
message:
$ref: '#/components/messages/messageAvro'
topic-proto-schema:
bindings:
googlepubsub:
topic: projects/your-project/topics/topic-proto-schema
messageRetentionDuration: 86400s
messageStoragePolicy:
allowedPersistenceRegions:
- us-central1
- us-central2
- us-east1
- us-east4
- us-east5
- us-east7
- us-south1
- us-west1
- us-west2
- us-west3
- us-west4
schemaSettings:
encoding: binary
name: projects/your-project/schemas/message-proto
publish:
message:
$ref: '#/components/messages/messageProto'
subscribe:
message:
$ref: '#/components/messages/messageProto'
topic-no-schema:
bindings:
googlepubsub:
topic: projects/your-project/topics/topic-no-schema
publish:
message:
$ref: '#/components/messages/messageNoSchema'
subscribe:
message:
$ref: '#/components/messages/messageNoSchema'
components:
messages:
messageAvro:
bindings:
googlepubsub:
schema:
name: projects/your-project/schemas/message-avro
type: avro
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
messageProto:
bindings:
googlepubsub:
schema:
name: projects/your-project/schemas/message-proto
type: protobuf
contentType: application/octet-stream
name: MessageProto
# Proto is currently not supported in AsyncAPI, we're simply
# indicating that there's a payload here.
payload: true
messageNoSchema:
contentType: application/octet-stream
description: A message having no schema
payload: true