Comments (5)
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.
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.
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.
Thank you very much for your support, everything is perfect now
from jawampa.
@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)
- State not changed to disconnected when connection is lost HOT 1
- Poloniex sequences HOT 13
- ApplicationError(wamp.error.invalid_uri, [], {}) even when URI is completely valid HOT 1
- How can I send a self-defined Java-class object(client) to fit a C++ class (server) by RPC HOT 1
- Web Connection works well on emulator but fail on real devices HOT 3
- Android < 5.0, TLSv1.2 and jawampa
- Problem with varargs in Publish method HOT 2
- Getting publication succeeded callback while network is disconnected HOT 2
- Subscription Id / Event History
- Convert to rxjava 2. Any plans?
- Subscription SocketTimeoutException
- Application throws java.lang.ClassNotFoundException: jdk.internal.misc.Unsafe exception during the creation of the client instance HOT 1
- Can we publish topic on session connection
- Android doesn't work HOT 1
- Correct way to make a client run
- wss secure websocket connection problem
- How to influence the json encoding/decoding? JsonViews possible? HOT 1
- Jawampa crashes when connections is closed. HOT 3
- Authentication in jawampa
- Cannot connect to server only on Android 7.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jawampa.