GithubHelp home page GithubHelp logo

Comments (5)

evgzakharov avatar evgzakharov commented on July 22, 2024

mb you could use base64 for your purpose

from jawampa.

Matthias247 avatar Matthias247 commented on July 22, 2024

Binary data serialization with Messagepack should work without issues, but I guess it would still be the best if you test and confirm it with the other clients and router of your choice.

The problem with json serialization is that most JSON serializers (including jackson) will serialize binary data simply into a base64 string, but the WAMP specification also requires a 0 character in front of that string (which some environments could also interpret as an empty string). Maybe jackson can also be configured to do that, I haven't studied this in detail.

from jawampa.

jrogers avatar jrogers commented on July 22, 2024

I'm using binary values with a router supporting only MessagePack and it works fine, Jackson will do the right thing.

The main issue you might run into as Matthias suggested is that if you are using a router with clients using both json and msgpack serializations, and your client using MessagePack calls a procedure or publishes an event containing binary data, and the receiving client is using json, the router will convert the binary to base64 automatically for the json client. Your json client would need to handle conversation from base64 to binary itself as the base64 can't be distinguished from a regular json string value, this is why the spec says to prepend the 0 char to allow this more easily. However if you are using Jackson or some other data binding framework, it should be fine since deserialization will likely just try to convert the base64 to say a byte[] value based on the binding type information.

from jawampa.

rich-jones avatar rich-jones commented on July 22, 2024

How do you tell the jawampa client to use MsgPack instead of JSON?
Is there any jawampa documentation beyond what is on its github landing page?
Thank you.

from jawampa.

Matthias247 avatar Matthias247 commented on July 22, 2024

See the added WampClientBuilder#withSerializations parameter from here: https://github.com/Matthias247/jawampa/pull/25/files

from jawampa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.