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

Fix Bug : Server sent event get blocked when ModifyResponseBodyGatewayFilterFactory is enable #2774

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vineetkala11
Copy link

@vineetkala11 vineetkala11 commented Nov 6, 2022

Fixes #2775

ModifyResponseBodyGatewayFilterFactory is blocker for SSE based resources because writeWith method of ModifiedServerHttpResponse is responsible to modify response body for stream and non stream mime-type, writeWith convert response body to Mono, this behavior of writeWith is a blocker for stream type SSE.

Due to this issue consumer of SSE endpoint getting all events in one go instead of in form of stream. Without ModifyResponseBodyGatewayFilterFactory things works perfectly.

This PR contains fix for this issue and idea is to handle writeAndFlushWith method differently for stream mime type, as writeAndFlushWith being called by writer only when response content type is of Stream media type.

Please review this PR, if looks ok please approve it.

…yFilterFactory is enable

ModifyResponseBodyGatewayFilterFactory is blocker for SSE because it convert Stream response body to Mono.
@vineetkala11 vineetkala11 changed the title Fix Bug : Server sent event get blocked ModifyResponseBodyGatewayFilterFactory is enable Fix Bug : Server sent event get block when ModifyResponseBodyGatewayFilterFactory is enable Nov 11, 2022
@vineetkala11 vineetkala11 changed the title Fix Bug : Server sent event get block when ModifyResponseBodyGatewayFilterFactory is enable Fix Bug : Server sent event get blocked when ModifyResponseBodyGatewayFilterFactory is enable Nov 11, 2022
@vineetkala11
Copy link
Author

Hello @spencergibb

Could you please have a look to this PR and share you feedbacks. This issue is a show stopper for those who enable ModifyResponseBodyGatewayFilterFactory to modify response body and response's media-type is text/event-stream.

Thanks

@vineetkala11
Copy link
Author

Hello @spencergibb

Due to below issue, build check was not completed within the given time frame. I am not sure is it due to environment issue at that moment or some other reason.

image

@vineetkala11
Copy link
Author

Hello @spencergibb ,

I've seen that the conflicts aren't too big. Is it okay if I check them out and resolve them?

@spencergibb
Copy link
Member

Go right ahead

@vineetkala11
Copy link
Author

Hello @spencergibb , please have a look, conflicts are resolved.

@vineetkala11
Copy link
Author

vineetkala11 commented Mar 19, 2024

Hello @spencergibb , its my bad, I used web view to resolve conflicts and missed one unused import, please retrigger build. I hope this time things goes well 🤞

@vineetkala11
Copy link
Author

@spencergibb, any update on this PR?

@vineetkala11
Copy link
Author

Hello @spencergibb , Do you have any news on this PR? Are you thinking of classifying it as a bug or a new enhancement?

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

Successfully merging this pull request may close these issues.

ModifyResponseBodyGatewayFilterFactory block stream response
3 participants