GithubHelp home page GithubHelp logo

How to get byte[] argument about jawampa HOT 6 CLOSED

 avatar commented on July 3, 2024
How to get byte[] argument

from jawampa.

Comments (6)

Matthias247 avatar Matthias247 commented on July 3, 2024

What do you mean with byte[] argument? Get all messages in serialized form instead of the deserialized form (with the ArrayNode and ObjectNode arguments)? If yes that is not possible with jawampa because the messages are already deserialized before they are pushed towards the Client/Server object.

Or are you referring to normal function calls or events where some of the parameters are of type byte[]?

from jawampa.

 avatar commented on July 3, 2024

no what i ideally look for is,
Observable<byte[]> client.subscribe("feed")
or something like that, imagine i'm gonna get loooooot of messages very fast, and i want no garbage to be generated because of those millions of messages my gc will trigger wery often, so i need to avoid any object creation, mostly for example when i process json, i ready byte[] from stream then parse it to java primitives which will not keep in heap, but will be in stack...

I'm describing high level problem, because of i'm gonna run many instances of websocket clients, and those will recieve lot of messages very fast, i want to avoid object creation (no jackson parsin or similar thing)...

is that possible with this lib? not currently but by design if i check out the code and try to provide such option do you think its possible with current architecture?

from jawampa.

Matthias247 avatar Matthias247 commented on July 3, 2024

It's currently not possible with this library and also wouldn't fit the architecture very good. The thing is: The messages are received in a Netty thread and are contained in Netty ByteBuf objects which are pooled per EventLoop. These are not intended to be passed into other threads (e.g. user application code). If you make a copy of the byte content in order to forward it it would most likely be more expensive than to deserialize it in the transport layer and only to forward the deserialized primitive types in Jackson format - which is what happens at the moment.

These things also don't work very good with the WAMP protocol in general, because all protocol information (e.g. request or subscription IDs, function ID, ...) are serialized together with the message content and with the same serialization format. There is no seperate WAMP message header which could be parsed standalone and then stripped of in order to give you only the payload.

from jawampa.

 avatar commented on July 3, 2024

Ok, i've also looked at code, it seems wamp will make things hard with this particular issue, but anyway i can see its a high level protocol, not caring about that low level access...
Thanks anyway, im closing issue. (i wonder if there is another way to start conversation on github without creating issues every time... like how do i just send a message or something like that...?)

from jawampa.

Matthias247 avatar Matthias247 commented on July 3, 2024

Yes, unfortunatly github only provides Issues and nothing like Discussions. The only possibility is to add it s a Label to an issue.

If there are general questions about WAMP they can be discussed in the associated newsgroup: https://groups.google.com/forum/#!forum/wampws

Please don't send private messages or emails. This is (as most open source projects) no project that offers private support and so everything should be discussed openly so that also all other people that are interested or have similar questions can get involved.

from jawampa.

 avatar commented on July 3, 2024

Sure, i tought about that as i wrote :) anyway thanks for good lib

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.