-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
Message delimiter is added several times if message payload exceeds 8192 when using jersey #590
Comments
The problem is in com.sun.jersey.core.util.ReaderWriter#writeToAsString. Even if you override BUFFER_SIZE using system property, it will still use default buffer size in writeToAsString method. Need to override the whole class in the classpath... |
I think the issue is in the interceptor itself, e.g a property needs to be added that check the size of the chunk and buffer it until Jersey send a smaller chunk. I will investigate... |
I will try to remove MessageLengthInterceptor and manually add the delimiter at message level |
So, the following workaround works: |
Just to make sure, try with the TrackMessageLengthInterceptor (not the MessageLengthInterceptor). Also the workaround will work as well using the TrackMessageLengthFilter. Thanks! |
Documented: https://github.com/Atmosphere/atmosphere/wiki/Multiple-messages-arrive-as-single-response-body-or-message-received-are-incomplete A custon interceptor can always be created to buffer the response, but it is recommended to use the BroadcastFilter instead. |
Hello Jean-Francois, I'm afraid http://goo.gl/T1yeq now points to a non-existent page (github shows a "CREATE NEW PAGE" dialog) - can you restore that link so we can give a it a try ? |
Hi, Before the change: After the change: I hope that saves you hours of debugging and wondering why all messages above 8K length are chunked. |
profes : Has your fix been filed as an issue against JERSEY ? |
Found an interesting issue.
Jersey uses BufferedWriter behind the scenes to write the message. If message payload exceeds 8192 (which is default defaultCharBufferSize in BufferedWriter) then postPayload in MessageLengthInterceptor is invoked several times for each 8192 bytes of the message. As result separator is added several times in the middle of message.
The text was updated successfully, but these errors were encountered: