Re: [hybi] Subscription/topic confusion

Tobias Oberstein <> Tue, 27 October 2015 22:09 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 739E61A1B22 for <>; Tue, 27 Oct 2015 15:09:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 0.1
X-Spam-Status: No, score=0.1 tagged_above=-999 required=5 tests=[BAYES_50=0.8, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id lf5hexmvSPs6 for <>; Tue, 27 Oct 2015 15:09:53 -0700 (PDT)
Received: from ( []) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 09AD21A1B03 for <>; Tue, 27 Oct 2015 15:09:53 -0700 (PDT)
Received: from [] ( by ( with Microsoft SMTP Server (TLS) id 8.3.377.0; Tue, 27 Oct 2015 15:09:51 -0700
To: Michal Fojtak <>, "" <>
References: <>
From: Tobias Oberstein <>
Message-ID: <>
Date: Tue, 27 Oct 2015 23:09:45 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: text/plain; charset="utf-8"; format=flowed
Content-Transfer-Encoding: 7bit
Archived-At: <>
Subject: Re: [hybi] Subscription/topic confusion
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Server-Initiated HTTP <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 27 Oct 2015 22:09:54 -0000

Am 20.10.2015 um 17:43 schrieb Michal Fojtak:
> WAMP protocol defines two main mechanisms - RPC via registrations and
> calls, event distribution via subscribe/publish.
> Callee can register procedure and such a procedure becomes an object
> which is tracked internally by router. Router "is aware" of
> registrations. Caller can query registrations via meta API.
> This is not a story of other wamp entity - the topic. Topic as such is
> not stored anyware in the router. Router is not aware of them. Potential
> subscriber cannot query available topics. Ironically, you can query
> subscriptions. But unless somebody subscribes to it, the topic object
> exists only in publisher.
> It kind of contradicts the main advantage of having a central hub -
> router which is aware of all objects - procedures and topics.

The analogy is as follows:

callee registers a procedure at a router, which results in a "registration"

subscriber subscribes to a topic at a router, which results in a 

both registrations and subscriptions can be listed via the WAMP meta API

neither callers nor publishers are tracked at the router until there is 
an actual call from a caller, or an event published by a publisher.

neither callers nor publishers can be listed

> Would it be possible to "register" topics like we can register procedures?
> We can then get a list of topics. We can define and describe them. And
> other useful things.
> P.S.: The subscription id is quite confusing as well. It is not really
> subscription identification. Router creates this id when a first

Yes, it is. Please see below ..

> subscriber subscribes to the topic. If there was a topic then we would
> have topic id and many subscriber ids for each individual subscriber
> which models the situation more naturally.

The subscription ID identifies the subscription that is managed by the 

The topic being subscribed to is only _one_ part of a subscription. E.g. 
the matching strategy (eg exact-match vs prefix-match) is also part of 
the subscription.

There can be 2 subscriptions with the _same_ topic, but different 
matching policies.

In fact, separating "subscription" from "topic" was a major change we 
did when moving from WAMP v1 to v2.