TopicSubRequest¶
Purpose¶
Subscription request for a pub/sub topic.
Type¶
Reception:
Record with fields:
topic
: TopicIdentity
Pub/sub topic identity
scope
: RoutingScope
Whether the subscription request is local-only or should be also sent to the network
Triggers:
Result
Behavior¶
If the topic already exists in the RoutingTable, the EngineIdentity of the requesting engine is added to the RoutingTable, and a TopicSubResponse is returned with a success result.
Otherwise, if the topic does not exist yet:
- when the
scope
is LocalOnly, an error is returned - when the
scope
is Any, the Router sends a SubscribeRequest to PubSub
Message flow¶
sequenceDiagram
%% --8<-- [start:sequence]
Any Local Engine ->>+ Router: TopicCreateRequest
Router ->>+ PubSub: SubscribeRequest
PubSub -->>- Router: SubscribeResponse
Router -->>- Any Local Engine: TopicCreateResponse
%% --8<-- [end:sequence]