Skip to content

Commit e4f32a6

Browse files
authored
Merge pull request #497 from opengeospatial/issue-488
Pub/Sub: fix doc refs and update to AsyncAPI 3
2 parents 9a9171a + fe61216 commit e4f32a6

File tree

4 files changed

+115
-70
lines changed

4 files changed

+115
-70
lines changed

extensions/pubsub/examples/yaml/asyncapi.yaml

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
asyncapi: '2.5.0'
1+
asyncapi: '3.0.0'
22
info:
33
title: AsyncAPI demo
44
version: '0.0.1'
@@ -10,34 +10,57 @@ info:
1010

1111
servers:
1212
mqtt_prod:
13-
url: example.org
13+
host: example.org
1414
protocol: mqtt
1515
description: MQTT endpoint
1616
security:
1717
- user-password: []
18+
1819
defaultContentType: application/json
1920

2021
channels:
21-
collections:
22-
subscribe:
23-
message:
24-
$ref: '#/components/messages/collection_msg'
25-
collections/wthr_stn:
26-
subscribe:
27-
message:
28-
$ref: '#/components/messages/collection_msg'
29-
collections/stream_gage:
30-
subscribe:
31-
message:
32-
$ref: '#/components/messages/collection_msg'
33-
collections/wthr_stn/items:
34-
subscribe:
35-
message:
36-
$ref: '#/components/messages/wthr_stn_msg'
37-
collections/stream_gage/items:
38-
subscribe:
39-
message:
40-
$ref: '#/components/messages/stream_gage_msg'
22+
notify-collections:
23+
address: collections
24+
messages:
25+
$ref: '#/components/messages/collection_msg'
26+
notify-collections-wthr-stn:
27+
address: collections/wthr_st:
28+
messages:
29+
$ref: '#/components/messages/collection_msg'
30+
notify-collections-stream-gage:
31+
address: collections/stream_gage:
32+
messages:
33+
$ref: '#/components/messages/collection_msg'
34+
notify-collections-wthr_stn-items:
35+
address: collections/wthr_stn/items:
36+
messages:
37+
$ref: '#/components/messages/wthr_stn_msg'
38+
notify-collections-stream_gage-items:
39+
address: collections/stream_gage/items:
40+
messages:
41+
$ref: '#/components/messages/stream_gage_msg'
42+
43+
operations:
44+
notify-collections:
45+
action: receive
46+
channel:
47+
$ref: '#/channels/notify-collections'
48+
notify-collections-wthr-stn:
49+
action: receive
50+
channel:
51+
$ref: '#/channels/notify-collections-wthr-stn'
52+
notify-collections-stream-gage:
53+
action: receive
54+
channel:
55+
$ref: '#/channels/notify-collections-stream_gage'
56+
notify-collections-wthr_stn-items:
57+
action: receive
58+
channel:
59+
$ref: '#/channels/notify-collections-wthr_stn-items'
60+
notify-collections-stream_gage-items:
61+
action: receive
62+
channel:
63+
$ref: '#/channels/notify-collections-stream_gage-items'
4164

4265
components:
4366
messages:

extensions/pubsub/standard/sections/annex-pubsub.adoc

Lines changed: 70 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The API is described using the https://www.asyncapi.com/[AysncAPI 2.5.0 specific
1010
====
1111
[source,yaml]
1212
----
13-
include::../examples/yaml/asyncapi.yaml[]
13+
include::../../examples/yaml/asyncapi.yaml[]
1414
----
1515
====
1616

@@ -19,7 +19,7 @@ Breaking down into the components:
1919
====
2020
[source,yaml]
2121
----
22-
asyncapi: '2.5.0'
22+
asyncapi: '3.0.0'
2323
info:
2424
title: AsyncAPI demo
2525
version: '0.0.1'
@@ -30,15 +30,15 @@ Breaking down into the components:
3030
3131
----
3232
====
33-
* The `asyncapi` field indicates you use the AsyncAPI version 2.5.0.
33+
* The `asyncapi` field indicates you use the AsyncAPI version 3.0.0.
3434
* The `info` field holds information about the API, such as its name, version, description, and license.
3535

3636
====
3737
[source,yaml]
3838
----
3939
servers:
4040
mqtt_prod:
41-
url: example.org
41+
host: example.org
4242
protocol: mqtt
4343
protocolVersion: 3.1.1
4444
description: MQTT endpoint
@@ -48,7 +48,7 @@ Breaking down into the components:
4848
----
4949
====
5050
* Each `server` object provides the following fields:
51-
** `url`: URL of the target broker (this may be relative to the API document)
51+
** `host`: the server hostname and port
5252
** `protocol`: Pub/Sub protocol supported by the server
5353
** `protocolVersion`: version of the Pub/Sub protocol supported by the server
5454
** `description`: string describing the host
@@ -58,7 +58,7 @@ Breaking down into the components:
5858
----
5959
servers:
6060
mqtt:
61-
url: example.org
61+
host: example.org
6262
protocol: mqtt
6363
protocolVersion: 3.1.1
6464
description: MQTT endpoint
@@ -68,7 +68,7 @@ servers:
6868
- 1883
6969
default: 1883
7070
amqp:
71-
url: example.org
71+
host: example.org
7272
protocol: amqp
7373
protocolVersion: 1.0.0
7474
description: AMQP endpoint
@@ -86,45 +86,45 @@ Different Pub/Sub protocols are supported as additional server objects, and can
8686
[source,yaml]
8787
----
8888
channels:
89-
collections:
90-
x-ogc-api-link:
91-
rel: data
92-
type: application/json
93-
href: https://example.org/collections
94-
subscribe:
89+
notify-collections:
90+
address: collections
91+
x-ogc-api-link:
92+
rel: data
93+
type: application/json
94+
href: https://example.org/collections
9595
message:
9696
$ref: '#/components/messages/collection_msg'
97-
collections/wthr_stn:
98-
x-ogc-api-link:
99-
rel: collection
100-
type: application/json
101-
href: https://example.org/collections/wthr_stn
102-
subscribe:
103-
message:
97+
notify-collections/wthr_stn:
98+
address: collections/wthr_stn
99+
x-ogc-api-link:
100+
rel: collection
101+
type: application/json
102+
href: https://example.org/collections/wthr_stn
103+
messages:
104104
$ref: '#/components/messages/collection_msg'
105-
collections/stream_gage:
106-
x-ogc-api-link:
107-
rel: collection
108-
type: application/json
109-
href: https://example.org/collections/stream_gage
110-
subscribe:
111-
message:
105+
notify-collections-stream_gage:
106+
address: collections/stream_gage
107+
x-ogc-api-link:
108+
rel: collection
109+
type: application/json
110+
href: https://example.org/collections/stream_gage
111+
messages:
112112
$ref: '#/components/messages/collection_msg'
113-
collections/wthr_stn/items:
114-
x-ogc-api-link:
115-
rel: items
116-
type: application/json
117-
href: https://example.org/collections/stream_gage/items
118-
subscribe:
119-
message:
113+
notify-collections-wthr_stn-items:
114+
address: collections/wthr_stn/items
115+
x-ogc-api-link:
116+
rel: items
117+
type: application/json
118+
href: https://example.org/collections/stream_gage/items
119+
messages:
120120
$ref: '#/components/messages/wthr_stn_msg'
121-
collections/stream_gage/items:
122-
x-ogc-api-link:
123-
rel: items
124-
type: application/json
125-
href: https://example.org/collections/stream_gage/items
126-
subscribe:
127-
message:
121+
collections-stream_gage-items:
122+
address: collections/stream_gage/items
123+
x-ogc-api-link:
124+
rel: items
125+
type: application/json
126+
href: https://example.org/collections/stream_gage/items
127+
messages:
128128
$ref: '#/components/messages/stream_gage_msg'
129129
----
130130
====
@@ -139,6 +139,35 @@ Different Pub/Sub protocols are supported as additional server objects, and can
139139
** `collections/wthr_stn/items`
140140
** `collections/stream_gage/items`
141141

142+
====
143+
----
144+
[source,yaml]
145+
operations:
146+
notify-collections:
147+
action: receive
148+
channel:
149+
$ref: '#/channels/notify-collections'
150+
notify-collections-wthr-stn:
151+
action: receive
152+
channel:
153+
$ref: '#/channels/notify-collections-wthr-stn'
154+
notify-collections-stream-gage:
155+
action: receive
156+
channel:
157+
$ref: '#/channels/notify-collections-stream_gage'
158+
notify-collections-wthr_stn-items:
159+
action: receive
160+
channel:
161+
$ref: '#/channels/notify-collections-wthr_stn-items'
162+
notify-collections-stream_gage-items:
163+
action: receive
164+
channel:
165+
$ref: '#/channels/notify-collections-stream_gage-items'
166+
----
167+
====
168+
169+
* The `operations` section lists the required operations and their send and receive capabiliites.
170+
142171
====
143172
[source,yaml]
144173
----

extensions/pubsub/standard/sections/clause_7_pubsub.adoc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ The OGC API building block approach would typically be used for shared component
2323

2424
The above workflow requires adherence to a hierarchy of channels, auto-discovery of channels, as well as processing of generic messages for broad interoperability by all components.
2525

26-
==== Message payloads
27-
28-
For smaller payload workflow, implementations of OGC API Standards can additionally provide a channel for notification metadata in order to receive a smaller message payload, which a user can process to determine whether to further interact with the referenced data granule or resource.
29-
30-
include::../recommendations/pubsub/REC_message-payloads.adoc[]
31-
3226
==== AsyncAPI
3327

3428
Based on research and testing, the Pub/Sub White Paper recommended the use of AsyncAPI. AsyncAPI provides an event-driven equivalent of what is provided by OpenAPI for OGC API Standards (description of protocols, channels, parameters, models, etc.). An implementation of the https://ogcapi.ogc.org/common/overview.html[OGC API landing page requirements class] can provide a link to an AsyncAPI document as follows:

extensions/pubsub/standard/sections/clause_9_pubsub-message-payload.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ an OGC API implementation ecosystem.
1919
_GeoJSON_ can provide a compact and machine readable encoding as a baseline for message notification.
2020

2121
include::../requirements/pubsub-message-payload/REQ_rc-geojson.adoc[]
22-
include::../recommendations/pubsub-message-payload/REC_links.adoc[]
2322

2423
==== Identifier
2524

0 commit comments

Comments
 (0)