Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Jersey » Jersey/Jetty API Handler/Container re-sends the GET request every 1 min (Jersey/Jetty API Handler/Container resends the GET request every 1 min if it does not receive the response within 1 minute)
Jersey/Jetty API Handler/Container re-sends the GET request every 1 min [message #1843208] Tue, 20 July 2021 09:04
Deepika Malik is currently offline Deepika MalikFriend
Messages: 3
Registered: July 2021
Junior Member
<jersey.version>2.23.2</jersey.version>
<jetty.version>9.4.11.v20180605</jetty.version>


There is a GET API resource registered with Jersey and I am hitting this API from Postman. In case, the num of records is less and can be fetched within 1 minute, API works fine. But, if the request takes more than 1 minute to process, the Jetty Container closes the previous request Socket and sends a new GET request to same API (no external requests are sent, Jetty is sending them itself).
In this way, there is a new API request every 1 min (for 6 mins which is Gateway Timeout) and there are 6 API requests running simultaneously. But, all of them fails with exception

An I/O error has occurred while writing a response message entity to the container output stream.


because the Socket Connections for all the API requests are already closed after 1 min.
I suspect that it has to do something with the IdleTimeout or ConnectionTimeout on Jersey or Jetty side. But, I am unable to find the exact root cause for it. I tried to search on this topic all over the internet but could not find an answer to the behaviour I am seeing on local.
I also suspect that this might be because of lack of SSL session on local. But, wanted an insight from you on how was this functionality of Jersey, Jetty and SSL designed and implemented.

FYI : There is no SSL Session being used on local. Only Production environment has SSL certificates and sessions. These are non-Async requests.

Q 1. Any idea why Jetty does that ?

Also, I tried to change the timeouts in ServerFactory like so, but nothing changed the above behavior :

((DefaultServerFactory)startupConfig.getServerFactory()).setIdleThreadTimeout(Duration.minutes(4));
startupConfig.getMetricsFactory().setFrequency(Duration.minutes(4));



Q 2. Any idea what settings need to be changed ?

On Production, SSL Sessions are being used and I don't see this problem there.

Q 3. How would SSL Session change this behavior of re-sending the new API requests bu Jetty ?
Previous Topic:Message Body Writer for Moxy List
Next Topic:atom+xml request type support with Jersey 2.35
Goto Forum:
  


Current Time: Wed Jun 29 14:14:34 GMT 2022

Powered by FUDForum. Page generated in 0.01955 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top