Re: [hybi] Subscription/topic confusion

Константин Буркалев <> Fri, 23 October 2015 09:44 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 2059E1B33E5 for <>; Fri, 23 Oct 2015 02:44:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 1.001
X-Spam-Level: *
X-Spam-Status: No, score=1.001 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, MIME_8BIT_HEADER=0.3, SPF_PASS=-0.001] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 8s6IuO3AAYoM for <>; Fri, 23 Oct 2015 02:44:11 -0700 (PDT)
Received: from ( [IPv6:2a00:1450:4010:c07::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id C443D1B33D8 for <>; Fri, 23 Oct 2015 02:44:10 -0700 (PDT)
Received: by lfbn126 with SMTP id n126so42814182lfb.2 for <>; Fri, 23 Oct 2015 02:44:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=u4lvooW9N78v5JQdR3Ec5T0QuU/964qEnxkhhM6YVs4=; b=xN/NTbihxfD9M3s0Euwxxi4lV2U05h+WUCHUjiCeCUM3WcLkzN+0/wat3u16B1Vz6u VhewC/a//+yiyEl3Uu+oNAEKR2T4ZFnqlX+i5Ssyw0bHmW5OIRGv8SFWagUeO1UKbtnL 1jpNaSV01v149WfZlFX8tDDGZNK6VioPh8eYLU8dR3RV29tBf8yzLv1fyKu4Yv9HyHXB AIt8a6ZHsze7hu8+oZdggCKFDjKrzjZsoDWzn7E2lbKOaYDHZSDfUlxZeCGFpxFyWQDu /CSiyjVq9pPotD8Q8rkxQAyNwG7Bnclq6eBjqokILwR1nj7QfM23LsLTTaC2h2Bhkbz2 q/Ng==
X-Received: by with SMTP id xs10mr10326656lbb.47.1445593448992; Fri, 23 Oct 2015 02:44:08 -0700 (PDT)
Received: from [] ( []) by with ESMTPSA id oi5sm3097320lbb.13.2015. (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Oct 2015 02:44:08 -0700 (PDT)
Content-Type: multipart/alternative; boundary="Apple-Mail=_E8262F4E-C6E4-476F-9F06-9F1371306ED3"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: =?utf-8?B?0JrQvtC90YHRgtCw0L3RgtC40L0g0JHRg9GA0LrQsNC70LXQsg==?= <>
In-Reply-To: <>
Date: Fri, 23 Oct 2015 12:44:06 +0300
Message-Id: <>
References: <>
To: Michal Fojtak <>
X-Mailer: Apple Mail (2.2104)
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: Fri, 23 Oct 2015 09:44:13 -0000

Hi Michal!

> 20 окт. 2015 г., в 18:43, 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.

Well, yep, there may be some confusion about topics. But let’s look at that from different side:
For example, in chat servers or irc, clients create topics as they needed, and you can not know which topics will be created in the future. Also, topics (rooms, channels) are created by users only when they first time need them. I don’t know cases, when user is aware of topics, that he will need in future. 
From this point, WAMP proto is describing common user pattern of work. 
Also, you can query info about topics in runtime via META API. Of course, there are a lot of gaps in specification about META API, but that is just another part we are working on.
In Pub/Sub pattern there is loose coupling between clients and topics, and there is no need for publisher to be aware of how much subscribers are there, or does this topic exist, i mean from technology point of view, but from business side, of course can be such requirements. 
But in RPC pattern it is necessary condition, because you can not just call some RPC, which doesn’t exist yet. And Callee provides RPC via it’s registration in router.

From my point of view, adding topic registration — is just one more, mostly unneeded step. And even if we add it, i, as WAMP implementor, will transparently send a register message to wamp router at first time topic is requested. 

As i mentioned earlier, we should extend and describe META API for how to retrieve topics list, info and so on.

> 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 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.
> _______________________________________________
> hybi mailing list

С уважением,
Константин Буркалев