serializers

21 views
Skip to first unread message

Michał Lipiński

unread,
Nov 9, 2016, 6:27:13 AM11/9/16
to Crossbar
Hi
also I was curious what serializer crossbar use so I put print in every serializers method serialize()  and I see that crossbar use cbor and json at the same time and only one client ...why is that? why not cbor only?


even if i put to my config serializers:["cbor"] nothing seems to change

Tobias Oberstein

unread,
Nov 9, 2016, 10:12:44 AM11/9/16
to cross...@googlegroups.com
Hi,

> also I was curious what serializer crossbar use so I put print in every
> serializers method serialize() and I see that crossbar use cbor and
json
> at the same time and only one client ...why is that? why not cbor only?

Crossbar.io supports multiple serializers _at the same time_, and can
translate transparently between clients using different serializers.

We support multiple serializers, because a) there are tradeoffs (eg JSON
is fast in browsers, because it is native code) and b) different WAMP
client languages have different levels of support for serializers.

> even if i put to my config serializers:["cbor"] nothing seems to change

Using this config, Crossbar.io will still _print_ all the available
serializers at startup in the log, but only use CBOR - only clients
supporting (and requesting) CBOR will be able to connect.

Cheers,
/Tobias

Michał Lipiński

unread,
Nov 10, 2016, 7:38:26 AM11/10/16
to Crossbar
thx for Your response,
but as I said - I put print in serialize method of every serializer, not on constructor or something, so I'm pretty confident that it serialize using json and cbor 

Tobias Oberstein

unread,
Nov 10, 2016, 9:26:49 AM11/10/16
to cross...@googlegroups.com

CB serializes every event published exactly once independent of the number of subscribers, but will do so (and cache the preserialized message) for every serializer installed - independent of the specific serializer negotiated for a specific client.

So you cannot convince yourself using naive print, but you could either use wireshark or turn on loglevel=trace in CB to watch the messages and bytes that actually get sent down the wire.

In any case: I am pretty sure it works;) dig deeper if you dont belive me . .

Sent from Mobile (Google Nexus 5)


--
You received this message because you are subscribed to the Google Groups "Crossbar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crossbario+unsubscribe@googlegroups.com.
To post to this group, send email to cross...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/crossbario/e8078f75-d193-4264-bc21-5df5c0d9e9e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages