crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 275 forks source link

wamp.registration.lookup doesn't seem to work with prefix #395

Closed mfojtak closed 8 years ago

mfojtak commented 9 years ago

I tried following: session.register('com.myapp.add2', add2);

When I then call session.call('wamp.registration.lookup', ["com.myapp.add2"]), I get the correct result.

However, when I call session.call('wamp.registration.lookup', ["com.myapp", { match: "prefix" }]) it returns following error:

_Potentially unhandled rejection [1] {"error":"wamp.error.no_suchregistration","args":[],"kwargs":{"message":"no registration with ID None exists on this dealer"}} (WARNING: non-Error used)

The prefix functionality doesn't seem to work. Or am I doing something wrong?

Please help

oberstet commented 9 years ago

We have to look into this to check. I make it a bug in the meantime to catch attention ..

oberstet commented 8 years ago

@mfojtak I just tried that with this https://github.com/crossbario/crossbarexamples/tree/master/metaapi

Works for me at least as of now with current trunk Crossbar.io and AutobahnPython.

Note: this might very well have been an issue in the past.

zzdever commented 5 years ago

The situation described by @mfojtak still not works.

As for my investigation, I found:

A procedure registered by session.register("com.myapp.funcs.add", add, { match: "prefix" }); can be found by calling session.call('wamp.registration.lookup', ["com.myapp.funcs.add", { match: "prefix" }])

However, two or more procedures with common prefix registered by: session.register("com.myapp.funcs.add1", add1); session.register("com.myapp.funcs.add2", add2); can not be found by calling session.call('wamp.registration.lookup', ["com.myapp.funcs.add", { match: "prefix" }])

I think what @mfojtak described is the second situation.

So, the conclusion is, option { match: "prefix" } in wamp.registration.lookup is for pattern-based registrations, and I have to provide the whole uri to lookup. But this is not for looking up procedures with common prefix. This is a little bit confusing. I reopen this issue for attention.