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

Support custom WAMP message attibutes #1214

Open
samangh opened this issue Jun 18, 2019 · 5 comments
Open

Support custom WAMP message attibutes #1214

samangh opened this issue Jun 18, 2019 · 5 comments

Comments

@samangh
Copy link

samangh commented Jun 18, 2019

When using the autobahn, how does one set a custom Option when registering an RPC end point?

The RegisterOptions object throws an exception when using an options that is not specified:

assert(match is None or (type(match) == six.text_type and match in [u'exact', u'prefix', u'wildcard']))
assert(invoke is None or (type(invoke) == six.text_type and invoke in [u'single', u'first', u'last', u'roundrobin', u'random']))
assert(concurrency is None or (type(concurrency) in six.integer_types and concurrency > 0))
assert(details is None or (type(details) == bool and details_arg is None))
assert(details_arg is None or type(details_arg) == str) # yes, "str" is correct here, since this is about Python identifiers!
assert force_reregister in [None, True, False]

Section 6.1 of the WAMP specification specifies that if an option is not understood by an implementation then it must be ignored. My understanding is that this means that that the client should transmit the option to the router but not otherwise act on it.

6.1 Extensibility

Some WAMP messages contain Options|dict or Details|dict elements. This allows for future extensibility and implementations that only provide subsets of functionality by ignoring unimplemented attributes. Keys in Options and Details MUST be of type string and MUST match the regular expression [a-z][a-z0-9_]{2,} for WAMP predefined keys. Implementations MAY use implementation-specific keys that MUST match the regular expression [a-z0-9]{3,}. Attributes unknown to an implementation MUST be ignored.

@samangh
Copy link
Author

samangh commented Jul 1, 2019

Any thoughts on this?

@oberstet
Copy link
Contributor

oberstet commented Jul 1, 2019

When using the autobahn, how does one set a custom Option when registering an RPC end point?

This is not exposed in Autobahn currently.

What router are you using?

@samangh
Copy link
Author

samangh commented Jul 2, 2019

I'm using a fork of https://github.com/darrenjs/wampcc. I'm implementing some additional functionality by using the Options element, as specified in the WAMP implementation.

@oberstet
Copy link
Contributor

oberstet commented Jul 3, 2019

The extensibility section in the paragraph https://wamp-proto.org/_static/gen/wamp_latest_ietf.html#rfc.section.6.1 relates to the WAMP community extending the protocol itself - it is not about user extensibility.

User extensibility - aka "custom attributes" or "implementation specific attributes" - is not in the spec, but discussed here: wamp-proto/wamp-proto#345

Thus, the first thing is to nail consensus on above issue on the WAMP spec adding x_ based custom attributes as an advanced feature to the WAMP spec.

When that is done, we need implementation .. and your PR #1216 is essentially what needs to be done here (it must then be reworked to use x_ attributes - not a custom dict).

@oberstet oberstet changed the title RegisterOptions: allow sending custom options when registering RPC Support custom WAMP message attibutes Jul 3, 2019
@oberstet
Copy link
Contributor

oberstet commented Jul 3, 2019

An important note is wamp-proto/wamp-proto#345 (comment) : I fully agree with @meejah : it would be good to have use cases (the "why?" from a user perspective) described. This ensures that we actually cover the goals when defining the feature in the spec ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants