In the following example, a publisher advertises a namespace to a relay before a subscriber asks that relay for namespaces under a prefix, so the relay reports it immediately. The publisher then advertises a second matching namespace, which the relay passes on as it arrives. When the publisher withdraws that advertisement, the relay tells the subscriber the namespace is gone.
Publisher Relay Subscriber
| | |
| PUBLISH_NAMESPACE | |
| (example-42) | |
|------------------------->| |
| PUBLISH_NAMESPACE_OK | |
|<-------------------------| SUBSCRIBE_NAMESPACE |
| | (example) |
| |<-------------------------|
| | SUBSCRIBE_NAMESPACE_OK |
| |------------------------->|
| | NAMESPACE |
| | (42) |
| |------------------------->|
| PUBLISH_NAMESPACE | |
| (example-123) | |
|------------------------->| |
| PUBLISH_NAMESPACE_OK | NAMESPACE |
|<-------------------------| (123) |
| |------------------------->|
| cancel PUBLISH_NAMESPACE | |
|------------------------->| |
| | NAMESPACE_DONE |
| | (123) |
| |------------------------->|
| | |
The NAMESPACE and NAMESPACE_DONE messages carry only the suffixes 42 and
123, because the prefix example is already known from the
SUBSCRIBE_NAMESPACE.