noisyboiler / wampy

Websocket RPC and Pub/Sub for Python applications and microservices
Mozilla Public License 2.0
127 stars 24 forks source link

Doc : how to setup the URL in the config.json file of crossbar #57

Closed foxmask closed 6 years ago

foxmask commented 6 years ago

Hi,

I think it could be useful to add something in the doc about how to setup the URL in the config.json file of crossbar. Because when starting from scratch, there is no URL parms.

So When running the app we get the error

wampy.errors.WampyError: The ``url`` value is required by Wampy. Please add to your configuration file. Thanks.

And I had to digg in the source to find where to wampy expected to see the URL parm to be able to add it in the config.json file of the crossbar router.

noisyboiler commented 6 years ago

oh god, you're right. and it shouldn't be required anymore! sorry. you should just be able to use a client as a context manager and pass in the URL. originally you had to pass in a path to the router config - which was dumb as in the real world you don't have this. but it was a kinda useful testing setup pattern. if you can't have a router running and use the client as a context manager, we have a problem. I'll endeavour to look into this asap and certainly make the docs clearer. thanks for raising this @foxmask

foxmask commented 6 years ago

but on the other side, if you don't use the context manager (and set the URL), you need the config.json file, don't you ? For the moment I just discover the project so I don't know yet how everything should be setup :)

foxmask commented 6 years ago

Link to this, I think there is an uncompliant version of the json config file with crossbar

when running crossbar check I get:

Checking local node configuration file: [...]/.crossbar/config.json
Error: encountered unknown attribute 'url' in Universal transport configuration

and worst with crossbar run

lib/python3.6/site-packages/crossbar/common/checkconfig.py", line 1861, in check_listening_transport_universal
    raise InvalidConfigException("encountered unknown attribute '{}' in Universal transport configuration".format(k))
crossbar.common.checkconfig.InvalidConfigException: encountered unknown attribute 'url' in Universal transport configuration

This explained that when I started the subscriber and the publisher, then cant find each other and finished with a connection timeout of 5s

The URL is at the right place for wampy (because I don't have the error at all) but that is not good for crossbar.

Does WAMPY depends on CROSSBAR router ? WAMPY does not provide a little one itself ?

noisyboiler commented 6 years ago

Hiya I'll have to come back to this properly when i'm not at work! but wampy should run on any WAMP compliant router. The test cases fire up crossbar. As far as i know that is the only router to use. wampy does not provide it's own bespoke router, it does however provide tools to manage your own instance of crossbar in your project's test cases.

noisyboiler commented 6 years ago

thanks again @foxmask fixed with https://github.com/noisyboiler/wampy/releases/tag/0.9.14