Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to increase jersey WS timeout

Tags:

How do I increase the jersey WS timeout? It is waiting on a call which takes around 2 minutes. It is timing out at WS layer. Do I have to increase client timeout as well? What are the defaults for these?

like image 459
Fakrudeen Avatar asked Oct 29 '10 08:10

Fakrudeen


2 Answers

You can use the two methods setConnectTimeOut and the setReadTimeout on your Client instance. The documentation specifies that the default values for both are null and thus the timeouts infinite.

like image 67
MobileSam Avatar answered Sep 23 '22 20:09

MobileSam


Do make sure to set the setReadTimeout as per the need of your application as setting connection timeout would be partial job done.

like image 30
Abhisar Swami Avatar answered Sep 25 '22 20:09

Abhisar Swami