You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: draft-ietf-core-coap-pubsub.md
+28-13
Original file line number
Diff line number
Diff line change
@@ -163,6 +163,7 @@ Topic-data interactions are publish, subscribe, unsubscribe, read, and delete. T
163
163
The Broker exports one or more topic collection resources, with resource type "core.ps.coll" defined in {{iana}} of this document. The interfaces for the topic collection resource is defined in {{topic-collection-interactions}}.
164
164
165
165
A topic collection resource can have topic resources as its child resources, with resource type "core.ps.conf".
166
+
Other child resource types are currently not defined for a topic collection resource.
166
167
167
168
# PubSub Topics {#topics}
168
169
@@ -198,7 +199,7 @@ Publication and subscription to a topic occur at a link, where the link target i
198
199
199
200
A topic resource with a topic-data link can also be simply called "topic".
200
201
201
-
The list of links to the topic resources can be retrieved from the associated topic collection resource, and represented as a Link Format document {{RFC6690}}where each such link specifies the link target attribute 'rt' (Resource Type), with value "core.ps.conf" defined in this document.
202
+
The list of links to the topic resources can be retrieved from the associated topic collection resource, represented as a Link Format document {{RFC6690}}where each link is a topic resource of type "core.ps.conf" as defined in this document.
@@ -235,10 +236,11 @@ The CBOR map includes the following configuration parameters, whose CBOR abbrevi
235
236
## Discovery
236
237
237
238
A client can perform a discovery of: the broker; the topic collection resources and topic resources hosted by the broker; and the topic-data resources associated with those topic resources.
239
+
Any server implementing a pubsub broker MUST support CoAP discovery with a query parameter as defined in {{Section 4.1 of RFC6690}} and as used in the examples in this section.
238
240
239
241
### Broker Discovery {#broker-discovery}
240
242
241
-
CoAP clients MAY discover brokers by using CoAP Simple Discovery, via multicast, through a Resource Directory (RD) {{RFC9176}} or by other means specified in extensions to {{RFC7252}}. Brokers MAY register with a RD by following the steps on {{Section 5 of RFC9176}} with the resource type set to "core.ps" as defined in {{iana}} of this document.
243
+
CoAP clients MAY discover brokers by using CoAP discovery, via multicast, through a Resource Directory (RD) {{RFC9176}} or by other means specified in extensions to {{RFC7252}}. Brokers MAY register with a RD by following the steps on {{Section 5 of RFC9176}} with the resource type set to "core.ps" as defined in {{iana}} of this document.
242
244
243
245
The following example shows an endpoint discovering a broker using the "core.ps" resource type over a multicast network. Brokers within the multicast scope will answer the query.
244
246
@@ -282,15 +284,19 @@ Example:
282
284
Header: Content (Code=2.05)
283
285
Content-Format: 40 (application/link-format)
284
286
Payload:
285
-
</ps>;rt="core.ps.coll";ct=40,
286
-
</other/path>;rt="core.ps.coll";ct=40
287
+
</ps>;rt="core.ps.coll",
288
+
</other/path>;rt="core.ps.coll"
287
289
~~~~
288
290
291
+
Note that the "ct" attribute is not included for the two collections in the returned link format document.
292
+
This is because the content-format of each topic collection resource is implied by its resource type (rt="core.ps.coll") to be 40 ("application/link-format").
293
+
294
+
289
295
### Topic Discovery {#topic-discovery}
290
296
291
297
Each topic collection is associated with a group of topic resources, each detailing the configuration of its respective topic (refer to {{topic-properties}}). Each topic resource is identified by the resource type "core.ps.conf".
292
298
293
-
Below is an example of discovery via /.well-known/core with rt=core.ps.conf that returns a list of topics, as the list of links to the corresponding topic resources.
299
+
Below is an example of discovery via /.well-known/core with query rt=core.ps.conf that returns a list of topics, as the list of links to the corresponding topic resources.
294
300
295
301
296
302
~~~~
@@ -306,18 +312,19 @@ Below is an example of discovery via /.well-known/core with rt=core.ps.conf that
306
312
Header: Content (Code=2.05)
307
313
Content-Format: 40 (application/link-format)
308
314
Payload:
309
-
</ps/h9392>;rt="core.ps.conf";ct=TBD606,
310
-
</other/path/2e3570>;rt="core.ps.conf";ct=TBD606
315
+
</ps/h9392>;rt="core.ps.conf",
316
+
</other/path/2e3570>;rt="core.ps.conf"
311
317
~~~~
312
318
313
319
### Topic-Data Discovery
314
320
315
321
316
322
Within a topic, there is the topic-data property containing the URI of the topic-data resource that a CoAP client can subscribe and publish to. Resources exposing resources of the topic-data type are expected to use the resource type 'core.ps.data'.
317
323
318
-
The topic-data contains the URI of the topic-data resource for publishing and subscribing. So retrieving the topic will also provide the URL of the topic-data (see {{topic-get-resource}}).
324
+
The topic-data key in the topic resource contains the URI of the topic-data resource for publishing and subscribing. So retrieving the topic will also provide the URL of the topic-data (see {{topic-get-resource}}).
319
325
320
-
It is also possible to discover a list of topic-data resources by sending a request to the collection with rt=core.ps.data resources as shown below.
326
+
It is also possible to discover a list of topic-data resources by sending a request to the collection with query rt=core.ps.data resources as shown below.
327
+
Any topic collection resource MUST support this query.
321
328
322
329
~~~~
323
330
Request:
@@ -331,9 +338,12 @@ It is also possible to discover a list of topic-data resources by sending a requ
331
338
Header: Content (Code=2.05)
332
339
Content-Format: 40 (application/link-format)
333
340
Payload:
334
-
</ps/data/62e4f8d>;rt="core.ps.data";obs
341
+
</ps/data/62e4f8d>
335
342
~~~~
336
343
344
+
Note that the "rt" attribute is not included in the returned link in the example response.
345
+
This is because the query in the request already constrains all links in the response to be only of type "core.ps.data".
These are the interactions that can happen directly with a specific topic collection.
@@ -345,6 +355,10 @@ A client can request a collection of the topics present in the broker by making
345
355
On success, the broker returns a 2.05 (Content) response, specifying the list of links to topic resources associated with this topic collection (see {{topic-resource-representation}}).
346
356
347
357
A client MAY retrieve a list of links to topics it is authorized to access, based on its permissions.
358
+
The payload content-format 40 ("application/link-format") MUST be at least supported for the collection resource.
359
+
Note that no "rt" or "ct" attributes are returned for the topic resources in the example payload, because
360
+
the resource type (rt="core.ps.conf") is already implied by this specification for the topic collection and
361
+
the content-format (TBD606) is implied by the resource type.
348
362
349
363
Example:
350
364
@@ -359,8 +373,7 @@ Example:
359
373
Header: Content (Code=2.05)
360
374
Content-Format: 40 (application/link-format)
361
375
Payload:
362
-
</ps/h9392>;rt="core.ps.conf",
363
-
</ps/2e3570>;rt="core.ps.conf"
376
+
</ps/h9392>,</ps/2e3570>
364
377
~~~~
365
378
366
379
### Getting topics by Properties {#topic-get-properties}
@@ -394,9 +407,11 @@ Example:
394
407
Header: Content (Code=2.05)
395
408
Content-Format: 40 (application/link-format)
396
409
Payload:
397
-
</ps/2e3570>;rt="core.ps.conf"
410
+
</ps/2e3570>
398
411
~~~~
399
412
413
+
Note that no "rt" or "ct" attributes are returned in the link format document, since the type of each link
414
+
(topic resource with rt="core.ps.conf") is implied as the default resource type of each topic resource by this specification.
0 commit comments