Closed connectdotz closed 7 years ago
Hi, @connectdotz! First of all, do you use msgpack.js that is included with wampy? Also, please post example of your js code for connecting to crossbar using wampy with msgpack encoding.
Hi,
First of all, do you use msgpack.js that is included with wampy?
Yes
please post example of your js code for connecting to crossbar using wampy with msgpack encoding
var connection = new Wampy(service_options.router, { realm: service_options.realm } ); connection.options({ reconnectInterval: 10000, maxRetries: 20, transportEncoding: 'msgpack', // this is the only difference between json and msgpack encoding onConnect: function () { ... connection.subscribe(uri, { onSuccess: function () { console.log('Successfully subscribed to ' + uri); }, onError: function (err) { console.log('Failed to subscribe to ' + uri + ', error:' + err); }, onEvent: function (results) { console.log('Received ranking result: ' + results); } }); console.log('Yahoo! We are online!'); }, onClose: function () { console.log('See you next time!'); }, onError: function () { console.log('Breakdown happened'); }, onReconnect: function () { console.log('Reconnecting...'); } }); connection.connect();
okey! I'll try to check wampy with crossbar and wiola.
One more info, here is the config file on the crossbar side:
{ "controller": { }, "workers": [ { "type": "router", "options": { "pythonpath": [".."] }, "realms": [ { "name": "test.realm.x", "roles": [ { "id": "anonymous", "name": "anonymous", "permissions": [ { "uri": "*", "publish": true, "subscribe": true, "call": true, "register": true } ] } ] } ], "transports": [ { "type": "websocket", "endpoint": { "type": "tcp", "port": 8080 }, "debug": true } ] } ] }
Well, i tried to remember, what was the problem, cause i was investigating that thing in past... Thankfully, goolge remember all things :) so you can read more about this problem in this thread: https://groups.google.com/forum/#!searchin/wampws/msgpack/wampws/eDfKK2agYjo/gcjnqs9jYGMJ New year is comming, and i'm going on holidays, if i'd have time, i'll try to investigate deeper. But may be you also can help.
Happy New Year then.
Where did you stand regarding the thread you mentioned above? Were you ever able to get msgpack protocol working with crossbar.io or any other routers?
Hi! Thanks! Fuh, Holidays are over! (We have holidays from 30.12 till 11.01). Well, what can i say:
I have a some kind of comparement file, you can download it here: http://ksdaemon.ru/dl/msgpack-test.zip Just open html file. There is a table where javascript msgpack lib is used to decode messages, encoded by itself, python lib and lua lib. From there you can see the difference in encoding strings.
What is most interesting, is that python encoded messages are very good decoded by lua, and there are no problems there. But when javascript is decoding python messages, there are problems. I can fix that by interpreting bin8 as strings, but that is not well.
Can not reproduce this bug in current versions.
"msgpack5": "^3.4.1"
Crossbar.io : 17.2.1 (Crossbar.io COMMUNITY)
Autobahn : 0.17.2 (with JSON, MessagePack, CBOR, UBJSON)
Twisted : 17.1.0-EPollReactor
LMDB : 0.92/lmdb-0.9.18
Python : 2.7.12/CPython
So, closing.
hi, I am using the latest wampy.js with backend crossbar.io 0.9.12 router. Everything worked as expected when using json transportEncoding, but when I switch over to msgpack, crossbar.io complaint about ProtocolError during the initial handshaking:
there is no warning on the wampy.js side. The failed message seems to be from the subscribe() call. I am not sure if it is a crossbar.io or or wampy.js issue, but giving crossbar.io is one of the most popular/mature WAMP router implementation, I would think it is important to make sure wampy.js is compatible.
Please let me know if there is anything I can provide to help track down this issue. Thanks.