You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've personally encountered this issue but I also saw others are experiencing it so I'm opening an issue.
The issue is that when you use Server-Sent Events in Subscriptions in Hot Chocolate and your server is running behind a reverse proxy such as Azure Application Gateway that uses response buffering, you either never receive subscription events or the events are delayed. The reason for this is because Hot Chocolate's endpoints don't add a specific header: X-Accel-Buffering set to no, which configures the reverse proxy to send data as its received rather than waiting for the entire (potentially endless) response.
I figured this out based off of this StackOverflow question but there isn't a lot of information about it that I've been able to find.
The solution you'd like
The solution I used to fix this problem was to add a middleware to detect whether we're serving GraphQL requests and to add this header:
This works, but I had to do it this way because I couldn't find a way to configure the headers that Hot Chocolate sends to include the header. It'd be advantageous if this was an option built into Hot Chocolate and documented so that anyone else using a setup like this can benefit.
The text was updated successfully, but these errors were encountered:
Product
Hot Chocolate
Is your feature request related to a problem?
I've personally encountered this issue but I also saw others are experiencing it so I'm opening an issue.
The issue is that when you use Server-Sent Events in Subscriptions in Hot Chocolate and your server is running behind a reverse proxy such as Azure Application Gateway that uses response buffering, you either never receive subscription events or the events are delayed. The reason for this is because Hot Chocolate's endpoints don't add a specific header:
X-Accel-Buffering
set tono
, which configures the reverse proxy to send data as its received rather than waiting for the entire (potentially endless) response.I figured this out based off of this StackOverflow question but there isn't a lot of information about it that I've been able to find.
The solution you'd like
The solution I used to fix this problem was to add a middleware to detect whether we're serving GraphQL requests and to add this header:
This works, but I had to do it this way because I couldn't find a way to configure the headers that Hot Chocolate sends to include the header. It'd be advantageous if this was an option built into Hot Chocolate and documented so that anyone else using a setup like this can benefit.
The text was updated successfully, but these errors were encountered: