eclipse-uprotocol / up-spec

uProtocol Specifications
Apache License 2.0
32 stars 25 forks source link

Remove Topic Creation and Deprecation from uSubscription APIs #96

Closed stevenhartley closed 5 months ago

stevenhartley commented 6 months ago

Early on in the development of uProtocol we baked in an optimization for subscribers to know existence of topics in a system by adding the APIs to uSubscription CreateTopic() and (originally) DeleteTopic(). The optimization required producers to call this API before subscribers could subscribe however this optimization only causing issues with initialization and added additional unnecessary messaging each time a uService is created.

Many other pub/sub communication protocols such as MQTT, SOME/IP, and zenoh do not require you to "create" a topic before you can subscribe to the topic, not to mention we have uDiscovery that could be leveraged to find out if a topic "exists" before you subscribe to it.

This, issue shall be use to deprecate the CreateTopic() and DeprecateTopic APIs from uSubscription APIs and implementation to simplify the subscription flow for developers.

AnotherDaniel commented 5 months ago

@stevenhartley, is it correct to assume that producers would still do RegisterForNotifications() on a topic they're going to produce, and that this is mandatory for a producer?

stevenhartley commented 5 months ago

@stevenhartley, is it correct to assume that producers would still do RegisterForNotifications() on a topic they're going to produce, and that this is mandatory for a producer?

No it is not mandatory for Producers, only for those who care if there are subscribers or not before they start producing (ex. we would not produce camera frames topic if there is no one who wants to view the camera as this is resource intensive opperation).

AnotherDaniel commented 5 months ago

Ok - one more Q then, even though this is not immediately relevant for me: in the camera example, and with the CreateTopic call gone - a camera frame subscriber would then "blindly" subscribe to the topic they think is the correct one for getting camera pics, and only then would the producer begin to actually publish?

stevenhartley commented 5 months ago

Merged