sampu

sampu

Keep Alive data packets configuration with Spring Webflux endpoint

I have a use case where a client is invoking a Rest endpoint via a load balancer, which in turn invokes a third party endpoint which is really slow to respond. The third party endpoint takes over 1 min to start sending the response. Because of this the client is getting 504 Gateway timeout due to the connection being idle for more than 60 seconds. We don’t want to alter the configuration of load balancer’s keep alive timeout rather want the Rest endpoint to send some keep alive data packets periodically till the data from third party endpoint is available ensuring that the connection is not idle for long time.

I can implement this by generating a Flux which periodically checks for data availability and returns a dummy packet till the data from third party endpoint is available.
Wanted to know if the same can be achieved just with some out of the box configuration. The goal is to just ensure that the connection does not remain idle till we have data available from the third part endpoint

Most Liked

OvermindDL1

OvermindDL1

You could have the rest endpoint send back empty http chunk responses, say, every 30 seconds? It’s not out of the box (as a load balancer generally should be configured to handle the backend correctly) but it’s pretty trivial to do.

Where Next?

Popular Backend topics Top

IhorYachmenov
Hello. I have an iOS app where needs a proxying website through private server(HTTP / HTTPS proxy), but its idea each time has some trou...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
New
Jsdr3398
I’ve been working on and rewriting my messaging platform several times for the past two years. With Discords new rebranding, it has reall...
New
Fl4m3Ph03n1x
Background I am now trying Gradual type checking, as a consequence I am giving a shot to Gradient. As I see it, this is an alternative to...
New
GermaVinsmoke
Does anyone know beginner friendly Elixir/Phoenix Open source projects? For learning purpose :slightly_smiling_face:
New
Fl4m3Ph03n1x
Background I have a module that uses TypedStruct to create structs. This is the code: defmodule Shared.Data.Authorization do @moduledo...
New
Sumityadav
Hello all, I am new to learning Java Programming and want to learn java from scratch. I was writing a Java program to get the first and l...
New
pillaiindu
What is the difference between using :references and :belongs_to in the following command? bin/rails generate scaffold LineItem product:...
New
yamuna
Hi everyone, I’m trying to run deepseek-coder:6.7b-instruct-q4_K_M in Docker using Ollama to create an LLM that will be used by CrewAI a...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
AstonJ
Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New