GithubHelp home page GithubHelp logo

Comments (5)

Matthias247 avatar Matthias247 commented on July 22, 2024

Hi. There is a maximum websocket frame size configured by Netty that equals to 64kb. Messages bigger than that size won't be delivered and maybe also the connection will get dropped. Don't know exactly.

However you can overwrite that limit through the NettyWampConnectionConfig class, which you can provide to the NettyWampClientConnectorProvider class. That should resolve the issue.

from jawampa.

beta2k avatar beta2k commented on July 22, 2024

Thank you very much, this helped (posting from another account right now).

As you said, we had to change static final int DEFAULT_MAX_FRAME_PAYLOAD_LENGTH = 65535; (see NettyWampConnectionConfig.java:8 ) to a higher value. we now changed it to static final int DEFAULT_MAX_FRAME_PAYLOAD_LENGTH = 2147483648; which equals 2^31.

so now, my event with about 70.000 characters in the argument arrives successfully at the subscriber. the new limit seems to be, however, 16.777.216 bytes (2^24 bytes or ~16mb). I will not exceed this limitiation for now, but I am really interested in who imposes this new limitation? Is there some other knob which I can turn around to still increase it?

EDIT: I just found out that the 16mb limitation comes from MAX_WEBSOCKET_FRAME_SIZE in WampHandlerConfiguration.java:22. So I just increased it. Is there something to be aware of when increasing the size of this?

from jawampa.

Matthias247 avatar Matthias247 commented on July 22, 2024

You don't need to change the jawampa source code and the DEFAULT_MAX_FRAME_PAYLOAD_LENGTH variable, you can just do

client =
WampClientBuilder.withConnectorProvider(new NettyWampClientConnectorProvider())
                 .withConnectionConfiguration((new NettyWampConnectionConfig.Builder()).withMaxFramePayloadLength(2147483648).build())
                 ....
                 .build();

Yes, you can change MAX_WEBSOCKET_FRAME_SIZE according to your needs. Just be aware that if you increase those limits that if malicous clients/servers pretent to send you very large websocket frames your application will try to allocate that amount of memory which can cause memory leaks or even crashes.

from jawampa.

datsat avatar datsat commented on July 22, 2024

Thank you very much for your support, everything is perfect now

from jawampa.

sebastianwahn avatar sebastianwahn commented on July 22, 2024

@Matthias247 can you put this somewhere on your README.md page? I had this issue also and tried to figure out whats the problem until i stumbled now on this solved ticket. Some FAQ or known issue sections with links to the solution would be great!

Unfortunately, the error handler on the makeSubscription is not triggered when the limit is exceeded. Maybe this would be also some good place to hint that something goes wrong?

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.