An entry within a topic collection in a broker. A topic-configuration resource is used for configuration purposes before any data can be published. CoAP clients can propose new topics to be created, but it is up to the broker to decide whether and how a topic is created. The broker also decides the URI of each topic-configuration and the topic-data resource when hosted at the broker. The creation, configuration, and discovery of topics at a broker are specified in Section 2. The lifecycle of a topic is specified in Section 2.6.1. Interactions about the topic-data are defined in Section 2.7. The topic-configuration URI is NOT used to to publish and subscribe to data. Throughout this document the word "topic" and "topic-configuration" can appear interchangeably.¶
+
An entry within a topic collection in a broker. A topic-configuration resource is used for configuration purposes before any data can be published. CoAP clients can propose new topics to be created, but it is up to the broker to decide whether and how a topic is created. The broker also decides the URI of each topic-configuration and the topic-data resource when hosted at the broker. The creation, configuration, and discovery of topics at a broker are specified in Section 2. The lifecycle of a topic is specified in Section 3.1. Interactions about the topic-data are defined in Section 3.3. The topic-configuration URI is NOT used to to publish and subscribe to data. Throughout this document the word "topic" and "topic-configuration" can appear interchangeably.¶
topic-data resource:
@@ -1355,7 +1357,7 @@
broker:
-
A CoAP server that hosts one or more topic collections containing topic-configurations and sometimes also topic-data resources. The broker is responsible for the store-and-forward of state update representations when the topic-data URI points to a resource hosted on the broker. The broker is also responsible of handling the topic lifecycle as defined in Section 2.6.1. The creation, configuration, and discovery of topics at a broker is specified in Section 2.¶
+
A CoAP server that hosts one or more topic collections containing topic-configurations and sometimes also topic-data resources. The broker is responsible for the store-and-forward of state update representations when the topic-data URI points to a resource hosted on the broker. The broker is also responsible of handling the topic lifecycle as defined in Section 3.1. The creation, configuration, and discovery of topics at a broker is specified in Section 2.¶
This document describes two sets of interactions, interactions to configure topics and their lifecycle (see Section 2.5) and interactions about the topic-data (see Section 2.7).¶
+
This document describes two sets of interactions, interactions to configure topics and their lifecycle (see Section 2.5) and interactions about the topic-data (see Section 3.3).¶
Topic-configuration interactions are discovery, create, read configuration, update configuration, delete configuration and handle the management of the topics.¶
Topic-data interactions are publish, subscribe, unsubscribe, read and are oriented on how data is transferred from a publisher to a subscriber.¶
The Broker exports a topic-collection resource, with resource type "core.ps.coll" defined in Section 5 of this document. The interfaces for the topic-collection resource is defined in Section 2.4.¶
+
The Broker exports a topic-collection resource, with resource type "core.ps.coll" defined in Section 6 of this document. The interfaces for the topic-collection resource is defined in Section 2.4.¶
@@ -1676,13 +1678,13 @@
A CoAP client can create a new topic by submitting an initial configuration for the topic (see Section 2.4.3). It can also read and update the configuration of existing topics and delete them when they are no longer needed (see Section 2.5).¶
The configuration of a topic itself consists of a set of properties that can be set by a client or by the broker. The topic-configuration is represented as a CBOR map containing the configuration properties of the topic as top-level elements.¶
-
Unless specified otherwise, these are defined in this document and their CBOR abbreviations are defined in Section 3.¶
+
Unless specified otherwise, these are defined in this document and their CBOR abbreviations are defined in Section 4.¶
The CBOR map includes the following configuration parameters, whose CBOR abbreviations are defined in Section 3 of this document.¶
+
The CBOR map includes the following configuration parameters, whose CBOR abbreviations are defined in Section 4 of this document.¶
'topic-name': A required field used as an application identifier. It encodes the topic name as a CBOR text string. Examples of topic names include human-readable strings (e.g., "room2"), UUIDs, or other values.¶
@@ -1711,40 +1713,40 @@
'observer-check': An optional field used to control the frequency at which the server hosting the topic-data will send a notification in a confirmable message to the observer. This prevents a client that is no longer interested or has disconnected from remaining indefinitely in the list of observers. Note that if the topic-data is not hosted by the broker but by another CoAP server it is up to that server to apply the observer-check value.¶
Below are the defined default values for the topic parameters:¶
-
-
'topic-name': There is no default value. This field is required and must be specified by the client or broker.¶
+
+
'topic-name': There is no default value. This field is required and must be specified by the client or broker.¶
-
-
'topic-data': There is no default value. This field is required and must be specified by the client or broker.¶
+
+
'topic-data': There is no default value. This field is required and must be specified by the client or broker.¶
-
-
'resource-type': The default value for a topic resource is "core.ps.conf".¶
+
+
'resource-type': The default value for a topic resource is "core.ps.conf".¶
-
-
'media-type': The default value is an empty string, indicating that no media type is specified.¶
+
+
'media-type': The default value is an empty string, indicating that no media type is specified.¶
-
-
'target-attribute': The default value is an empty string, indicating that no attribute is specified.¶
+
+
'target-attribute': The default value is an empty string, indicating that no attribute is specified.¶
-
-
'expiration-date': The default value is an empty string, indicating that no expiration date is specified. If this field is not present, the topic will not expire automatically.¶
+
+
'expiration-date': The default value is an empty string, indicating that no expiration date is specified. If this field is not present, the topic will not expire automatically.¶
-
-
'max-subscribers': The default value is -1, indicating that there is no limit to the number of subscribers allowed. If this field is not present, the pubsub system will not limit the number of subscribers for the topic.¶
+
+
'max-subscribers': The default value is -1, indicating that there is no limit to the number of subscribers allowed. If this field is not present, the pubsub system will not limit the number of subscribers for the topic.¶
-
-
'observer-check': The default value is '86400', as defined in [RFC7641], which corresponds to 24 hours.¶
+
+
'observer-check': The default value is '86400', as defined in [RFC7641], which corresponds to 24 hours.¶
CoAP clients MAY discover brokers by using CoAP Simple Discovery, via multicast, through a Resource Directory (RD) [RFC9167] or by other means specified in extensions to [RFC7252]. Brokers MAY register with a RD by following the steps on Section 5 of [RFC9167] with the resource type set to "core.ps" as defined in Section 5 of this document.¶
+
CoAP clients MAY discover brokers by using CoAP Simple Discovery, via multicast, through a Resource Directory (RD) [RFC9167] or by other means specified in extensions to [RFC7252]. Brokers MAY register with a RD by following the steps on Section 5 of [RFC9167] with the resource type set to "core.ps" as defined in Section 6 of this document.¶
@@ -1896,7 +1898,7 @@
A client can add a new topic-configurations to a collection of topics by submitting a representation of the initial topic resource (see Section Section 2.2) in a POST request to the topic collection URI. The topic MUST contain at least a subset of the Section 2.2.1 , namely: topic-name and resource-type.¶
A CoAP endpoint creating a topic MAY specify a topic-data URI different than that used by the broker. The broker may then simply forward the observation requests to the topic-data URI as shown in Figure 5.¶
-
If the topic-data is empty the broker will assign a resource for a publisher to publish to. Please note that the topic will NOT be fully created until a publisher has published some data to it (See Section 2.6.1).¶
+
If the topic-data is empty the broker will assign a resource for a publisher to publish to. Please note that the topic will NOT be fully created until a publisher has published some data to it (See Section 3.1).¶
On success, the server returns a 2.01 (Created) response indicating the topic URI of the new topic and the current representation of the topic resource.¶
If a topic manager is present in the broker, the topic creation may require manager approval subject to certain conditions. If the conditions are not fulfilled, the manager MUST respond with a 4.03 (Forbidden) error. The response MUST have Content-Format set to "application/core-pubsub+cbor".¶
The broker MUST respond with a 4.00 (Bad Request) error if any received parameter is specified multiple times, invalid or not recognized.¶
@@ -1941,7 +1943,7 @@
A client can read the configuration of a topic by making a GET request to the topic resource URI.¶
On success, the server returns a 2.05 (Content) response with a representation of the topic resource. The response has as payload the representation of the topic resource as specified in Section 2.2.¶
If a topic manager (TBD) is present in the broker, retrieving topic information may require manager approval subject to certain conditions (TBD). If the conditions are not fulfilled, the manager MUST respond with a 4.03 (Forbidden) error. The response MUST have Content-Format set to "application/core-pubsub+cbor".¶
-
The response payload is a CBOR map, whose possible entries are specified in Section 2.2 and use the same abbreviations defined in Section 3.¶
+
The response payload is a CBOR map, whose possible entries are specified in Section 2.2 and use the same abbreviations defined in Section 4.¶
For example, below is a request on the topic "ps/h9392":¶
@@ -1974,7 +1976,7 @@
The request contains a CBOR map with a configuration filter or 'conf-filter', a CBOR array with CBOR abbreviation. Each element of the array specifies one requested configuration parameter of the current topic resource (see Section 2.2).¶
On success, the server returns a 2.05 (Content) response with a representation of the topic resource. The response has as payload the partial representation of the topic resource as specified in Section 2.2.¶
If a topic manager (TBD) is present in the broker, retrieving topic information may require manager approval subject to certain conditions (TBD). If the conditions are not fulfilled, the manager MUST respond with a 4.03 (Forbidden) error.¶
-
The response payload is a CBOR map, whose possible entries are specified in Section 2.2 and use the same abbreviations defined in Section 3.¶
+
The response payload is a CBOR map, whose possible entries are specified in Section 2.2 and use the same abbreviations defined in Section 4.¶
Both request and response MUST have Content-Format set to "application/core-pubsub+cbor".¶
The overview of the publish/subscribe mechanism over CoAP is as follows: a publisher publishes to a topic by submitting the data in a PUT request to a topic-data resource and subscribers subscribe to a topic by submitting a GET request with the Observe option active to a topic-data resource. When resource state changes, subscribers observing the resource [RFC7641] at that time will receive a notification.¶
-
As shown in Section 2, each topic contains two resources: topic-configuration resource and topic-data. In that section we explained the creation and configuration of the topic-configuration resources. This section will explain the management of topic-data resources.¶
-
A topic-data resource does not exist until some initial data has been published to it. Before initial data has been published, the topic-data resource yields a 4.04 (Not Found) response. If such a "half created" topic is undesired, the creator of the topic can simply immediately publish some initial placeholder data to make the topic "fully created" (see Section 2.6.1).¶
-
URIs for topic resources are broker-generated (see Section 2.4.3). URIs for topic-data MAY be broker-generated or client-generated. There is no necessary URI pattern dependence between the URI where the data exists and the URI of the topic resource. Topic resource and data resources might even be hosted on different servers.¶
The overview of the publish/subscribe mechanism over CoAP is as follows: a publisher publishes to a topic by submitting the data in a PUT request to a topic-data resource and subscribers subscribe to a topic by submitting a GET request with the Observe option active to a topic-data resource. When resource state changes, subscribers observing the resource [RFC7641] at that time will receive a notification.¶
+
As shown in Section 2, each topic contains two resources: topic-configuration resource and topic-data. In that section we explained the creation and configuration of the topic-configuration resources. This section will explain the management of topic-data resources.¶
+
A topic-data resource does not exist until some initial data has been published to it. Before initial data has been published, the topic-data resource yields a 4.04 (Not Found) response. If such a "half created" topic is undesired, the creator of the topic can simply immediately publish some initial placeholder data to make the topic "fully created" (see Section 3.1).¶
+
URIs for topic resources are broker-generated (see Section 2.4.3). URIs for topic-data MAY be broker-generated or client-generated. There is no necessary URI pattern dependence between the URI where the data exists and the URI of the topic resource. Topic resource and data resources might even be hosted on different servers.¶
When a topic is newly created, it is first placed by the server into the HALF CREATED state (see Figure 4). In this state, a client can read and update the configuration of the topic and delete the topic. A publisher can publish to the topic-data resource. However, a subscriber cannot yet observe the topic-data resource nor read the latest data.¶
When a topic is newly created, it is first placed by the server into the HALF CREATED state (see Figure 4). In this state, a client can read and update the configuration of the topic and delete the topic. A publisher can publish to the topic-data resource. However, a subscriber cannot yet observe the topic-data resource nor read the latest data.¶
Interactions with the topic-data resource are covered in this section. The interactions with topic-data are same as that of any other CoAP resource.¶
-
One variant shown in Figure 5 is where the resource is hosted. While the broker can create a topic-data resource when the topic is created, the client can select to host the data in a different CoAP server than that of the topic resource.¶
+
Interactions with the topic-data resource are covered in this section. The interactions with topic-data are same as that of any other CoAP resource.¶
+
One variant shown in Figure 5 is where the resource is hosted. While the broker can create a topic-data resource when the topic is created, the client can select to host the data in a different CoAP server than that of the topic resource.¶