Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reloading instance on "No async message support and buffer too small" #174

Open
bekasov opened this issue Apr 8, 2024 · 8 comments
Open

Comments

@bekasov
Copy link

bekasov commented Apr 8, 2024

Hello, we are implementing some data exchange using async js and java calls (get/set clipboard content), it works when app run from "gradle jproRun" or by unpacking a zip from the "gradle jproRelease", but when we run it with the Loadbalancer and trying to paste some more html than usual (but not so big, its about 100 rows of html table with 4 columns of text), then the app's page starts reloading and Browser's console shows the following error:

jpro - con: 1 WebSocket connection closed - code: 1009 reason: No async message support and buffer too small. Buffer size: [8,192], Message size: [2,018]

Is there some settings to grow the buffer or something else to make the Loadbalancer work?

@besidev
Copy link

besidev commented Apr 8, 2024

Hello @bekasov,

Thank you for reaching out with the details of the issue you're experiencing. It seems like the root cause of the problem is related to the maximum web socket message size limitation when running your application with the Loadbalancer. The default value for the maximum message size is currently set to 1000000 bytes.

To address this issue, you can configure the one.jpro.loadbalancer.maxMessageSize property to a higher value than actual 1000000. Here’s how you can do it:

  1. Create a file named application.properties in the root directory of your application.
  2. Open the application.properties file and add the following line to specify a new maximum message size:
    one.jpro.loadbalancer.maxMessageSize=your_desired_size_in_bytes
    Replace your_desired_size_in_bytes with the maximum message size you wish to set, ensuring it's higher than the default 1000000 bytes.
  3. When starting your application with the Loadbalancer, ensure that this custom application.properties file is recognized. Typically, this involves placing the application.properties file in a directory that is loaded by the application at runtime, or use the following command line:
java -Dspring.config.location=file:/path/to/your/custom/application.properties -jar jpro-loadbalancer.jar

This solution will help you work around the message size limitation. Meanwhile, we're actively working on a more general approach to address this issue within the JPro implementation. The goal is to make it automatically adjust to every use case, eliminating the need for manual configuration of the message size in the future.

@bekasov
Copy link
Author

bekasov commented Apr 9, 2024

@besidev thank you for detailed answer, but I set the

one.jpro.loadbalancer.maxMessageSize = 100000000

and run the loadbalancer with full path of the application.settings, but it has no effect, the page keep reloading when I paste my html table.
I have measured the size of inserting html - it is less than 24Kb, but if I would add one more zero to my current one.jpro.loadbalancer.maxMessageSize (now it is 100'000'000, and I trying to set 1'000'000'000), the page will start reloading constantly, without any input. It seems like the maxMessageSize is reached to the loadbalancer, but for my case it is not working.
Any ideas? Maybe you mean other version of the loadbalancer, now I am using from here, version 0.10.0.

@besidev
Copy link

besidev commented Apr 10, 2024

We have updated the Loadbalancer documentation. The latest release version is 0.11.0. Take a look there for more detailed information.

PS: Please make sure that the custom configuration file is called application.properties and not application.settings. I have also updated in the previous post the correct way to pass -D arguments before -jar following the standard Java command line model for every terminal:

java [-options] -jar jarfile [args...]

@FlorianKirmaier
Copy link
Contributor

@bekasov
For your information - we are working on a general solution for this Problem.
Then it will always work without a configuration value (which doesn't seem to work consistently)
It will be available in the next update.

@bekasov
Copy link
Author

bekasov commented Jun 10, 2024

@FlorianKirmaier @besidev
Hello, just for information, loadbalancer v.0.12 is still reload the page on not so big messages, complaining to buffer size and message size, and the one.jpro.loadbalancer.maxMessageSize paraneter do not give any effect, we have to run our web solution without the loadbalancer to test it.
(plugin updated to 2024.2.1)

@FlorianKirmaier
Copy link
Contributor

Thank you for the quick feedback.
That's surprising, but we'll take a look. The parameter one.jpro.loadbalancer.maxMessageSize should no longer be necessary because JPro no longer internally creates big messages—if they are big, they are now split into multiples.
Could you let me know if you are sure you are using both correct versions?

@bekasov
Copy link
Author

bekasov commented Jun 10, 2024

Yes, I have just rechecked again, loadbalancer - 0.12, jpro - 2024.2.1, error message - jpro - con: 1 WebSocket connection closed - code: 1009 reason: No async message support and buffer too small. Buffer size: [8,192], Message size: [1,597], message size depends on size of data on my clipboard

@FlorianKirmaier
Copy link
Contributor

Hi
I've been able to reproduce this problem now with the latest version.
We'll provide a fix and contact you when it's available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants