A question about realms and URI

17 views
Skip to first unread message

nico....@gmail.com

unread,
Jun 1, 2016, 4:05:53 AM6/1/16
to CppWAMP
Hello, 

If I understood correctly a realm is a string that is used to identify a topic. If both sender and receiver use the same realm they will be able to receive each others messages, if they use different realms they will not be able to able to communicate with each other. 

With this in mind I would like to create a program where the last part of the realm is determined at run time. 
For example: 
When the application is started, a configuration file is loaded that tells the application that there might be a user called "nico". The application will then create a session with the realm "application_name.users.nico" and start to publish data for this user. 
If a client to were to connect using the same realm, that client would subscribe to the notifications and start receiving the data published for the user "nico" from that moment on.

Now my question is, would this be the correct way to set it up? And how can I actually set it up?

I have tried using the crossbar.io to configure the realm "application_name.users", but obviously I don't know what the last part of the realm will be. If I then try to connect using the realm "application_name.users.nico" I get an error 22: "no realm "application_name.users.nico" exists on this router", which is obviously correct. 
I found some information about "patern based subscriptions", but that seems to be the other way around (it would mean subscribing to all published data in "application_name.users" regardless of the last section). Is there a similar way to convince the server to accept every realm that start with e.g.: "application_name.users"?

Kind regards, Nico Nijman

Emile Cormier

unread,
Jun 1, 2016, 11:08:11 AM6/1/16
to CppWAMP
Nico,

On Wednesday, June 1, 2016 at 5:05:53 AM UTC-3, nico wrote:
Hello, 

If I understood correctly a realm is a string that is used to identify a topic. If both sender and receiver use the same realm they will be able to receive each others messages, if they use different realms they will not be able to able to communicate with each other. 

No, you misunderstand. Realms serve to isolate different web apps (or perhaps even subsystems of an app) from one another.

Different topics are setup by using different pub-sub topic URIs. For example,

- users.emile.on_message
- users.nico.on_message

To prevent unauthorized access to pub-sub topics, you can use Crossbar's static or dynamic authorization feature.

Your question is not specific to the CppWAMP client implementation. You'd get more help and answers asking on the WAMP group, or on Stackoverflow using the "wamp-protocol" tag.

Cheers,
Emile
Reply all
Reply to author
Forward
0 new messages