Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pub or Sub with prefix sends incorrect topic name in request #11

Closed
eXtreme opened this issue Mar 3, 2013 · 1 comment
Closed

Pub or Sub with prefix sends incorrect topic name in request #11

eXtreme opened this issue Mar 3, 2013 · 1 comment

Comments

@eXtreme
Copy link

eXtreme commented Mar 3, 2013

I am not sure but current behavior is weird and seems to be a bug.

If I create a prefix, let's say

sess.prefix("test", "http://example.org/test#");

and then use it like this

sess.subscribe('test:foobar');

The real call is made with "test:foobar" instead of http://example.org/test#foobar
The tutorial http://autobahn.ws/js/tutorials/pubsub in "Topic URIs" section says:

Calling the 'prefix' method (line 9) has now established 'event' as shorthand for

http://example.com/events/myevent/

By using the prefix, we can write

event:firstevent

instead of

http://example.com/events/myevent/firstevent

So the real behavior differs from the documentation.

Check these lines:
https://github.com/tavendo/AutobahnJS/blob/master/autobahn/autobahn.js#L712
https://github.com/tavendo/AutobahnJS/blob/master/autobahn/autobahn.js#L767

A msg which is sent contains "topicuri" var instead of "rtopicuri".

@oberstet
Copy link
Contributor

oberstet commented Mar 4, 2013

With WAMPv1, prefixes serve 2 purposes: shorthand for programming and reducing wire traffic. Hence, when prefixes have been established, then URIs are sent in prefixed (CURIE) form. There is no bug here ..

@oberstet oberstet closed this as completed Mar 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants