Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First rewrite of the uSubscription spec #238

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AnotherDaniel
Copy link

@AnotherDaniel AnotherDaniel commented Sep 10, 2024

Restructuring and partial rewrite of this spec; specific focus on:

  • more detailed explanations of concepts like remote subscriptions
  • migrate diagrams into embedded mermaid
  • add OFT-style requirements markers

@AnotherDaniel AnotherDaniel added the documentation Improvements or additions to documentation label Sep 10, 2024
@AnotherDaniel AnotherDaniel self-assigned this Sep 10, 2024
Comment on lines +29 to +31
- link:../../../basics/uri.adoc[unified addressing] scheme
- link:../../../up-l2/dispatchers/README.adoc[message forwarding] between different pub-sub domains
- link:../../udiscovery/v3/README.adoc[discoverability] of available publishers/publications
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should better use the xref macro instead of the link macro (https://docs.asciidoctor.org/asciidoc/latest/macros/link-macro/#when-to-use-the-link-macro)

- link:../../../up-l2/dispatchers/README.adoc[message forwarding] between different pub-sub domains
- link:../../udiscovery/v3/README.adoc[discoverability] of available publishers/publications
- cross-system tracking of subscriptions, especially to/from remote systems (this specification)
- option for link:../../utwin/v2/README.adoc[local caching and temporally decoupled access] to published data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use xref


In a distributed pubsub network, there exist two subscription scenarios: local subscriptions and remote subscriptions.

A local subscription is the conventional case where a subscriber requests a message from a publisher on the same transport network, both parties using the same pubsub implementation. For instance, imagine a MQTT broker used by publishers and subscribers, all deployed within the same system context.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A local subscription is the conventional case where a subscriber requests a message from a publisher on the same transport network, both parties using the same pubsub implementation. For instance, imagine a MQTT broker used by publishers and subscribers, all deployed within the same system context.
In the local case a client subscribes to messages published by a uEntity on the same transport network, both parties using the same pubsub implementation. For instance, imagine an MQTT broker used by publishers and subscribers, all deployed within the same system context.


A local subscription is the conventional case where a subscriber requests a message from a publisher on the same transport network, both parties using the same pubsub implementation. For instance, imagine a MQTT broker used by publishers and subscribers, all deployed within the same system context.

In contrast, a remote subscription scenario involves publishers and subscribers using different pubsub implementations and/or being located on different systems. For instance, a client interacting with a co-located MQTT broker to subscribe messages that actucally originate from a low-level mechatronics device, being published via SOME/IP.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In contrast, a remote subscription scenario involves publishers and subscribers using different pubsub implementations and/or being located on different systems. For instance, a client interacting with a co-located MQTT broker to subscribe messages that actucally originate from a low-level mechatronics device, being published via SOME/IP.
In contrast, a remote subscription scenario involves publishers and subscribers using different pubsub implementations and/or being located on different systems. For instance, a client interacting with a co-located MQTT broker to subscribe to messages that originate from a low-level mechatronics device, being published via SOME/IP.


In contrast, a remote subscription scenario involves publishers and subscribers using different pubsub implementations and/or being located on different systems. For instance, a client interacting with a co-located MQTT broker to subscribe messages that actucally originate from a low-level mechatronics device, being published via SOME/IP.

To be workable, the remote subscription scenario requires a dispatcher (`uStreamer`) which is able to forward published messages from one pubsub network to another. To do so intelligently (i.e., only forward traffic that actually is requested by a remote entity), some form of bookkeeping is needed to keep track of local and remote subscriptions, synchronize remote subscription requests with their bookkeeping counterpart on the remote system, and serve as information source for subscription states for the dispatcher entity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To be workable, the remote subscription scenario requires a dispatcher (`uStreamer`) which is able to forward published messages from one pubsub network to another. To do so intelligently (i.e., only forward traffic that actually is requested by a remote entity), some form of bookkeeping is needed to keep track of local and remote subscriptions, synchronize remote subscription requests with their bookkeeping counterpart on the remote system, and serve as information source for subscription states for the dispatcher entity.
To be workable, the remote subscription scenario requires a dispatcher (`uStreamer`) which is able to forward published messages from one pubsub network to another. To do so intelligently, i.e. only forward traffic that actually is requested by a remote entity, some form of bookkeeping is needed to keep track of local and remote subscriptions, synchronize remote subscription requests with their bookkeeping counterpart on the remote system, and serve as information source for subscription states for the dispatcher entity.


[.specitem,oft-sid="req~usubscribe-remote-max-timeout~1",oft-needs="impl"]
--
Remote Subscribe/Unsubscribe requests *MUST* have a maximum timeout of 5 minutes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should instead define a minimum time to wait instead ...


[.specitem,oft-sid="req~usubscribe-remote-retry-indefinitely~1",oft-needs="impl"]
--
Timed-out remote commands *MUST* be retied indefinitely until the business logic behind it no longer requires the command to be sent (ex. the last subscriber calls unsubscribes from a topic that is in state `SUBSCRIPTION_PENDING`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Timed-out remote commands *MUST* be retied indefinitely until the business logic behind it no longer requires the command to be sent (ex. the last subscriber calls unsubscribes from a topic that is in state `SUBSCRIPTION_PENDING`).
Timed-out remote commands *MUST* be retried indefinitely until the business logic behind it no longer requires the command to be sent (e.g. because the last entity unsubscribed from a topic that is in state `SUBSCRIPTION_PENDING`).

Comment on lines +267 to +269
--
Remote commands *MAY* be retried upon device to device connectivity (link up) and *MAY NOT* be tried when there is no device connectivity (link down).
--
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no requirement to meet here ...

* uSubscription *MUST* change the subscriber to itself (core.usubscription) when subscribing to remote topics, this allows the reverse flow (publication) to be properly multicasted to local subscribers by the local disaptcher (ex. uBus) when it queries the local uSubscription for a list of local subscribers
To allow the reverse flow (publication) to be properly multicast to local subscribers by the local disaptcher when it queries the local uSubscription for a list of local subscribers:

[.specitem,oft-sid="req~usubscribe-remote_subscribe-subscriber-change~1",oft-needs="impl,utest"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dsn~


[.specitem,oft-sid="req~usubscribe-remote_unsubscribe-subscriber-change~1",oft-needs="impl,utest"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dsn~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants