-
Notifications
You must be signed in to change notification settings - Fork 9
Need an API to set socket timeout for URLConnection that SAAJ uses #70
Comments
Reported by neoneo008 |
Was assigned to super_glassfish |
neoneo008 said: |
gagordon said: That said, to quote one article I found on Java socket timeouts, "Keeping [an] unused TCP connection open for [a] long time without any traffic isn't that trivial. Many firewalls/routers close the unused ports after some timeout." So given this, I am not sure whether your service design might benefit from being asynchronous if it is prone to timeout. It is my personal experience in dealing with these kinds of timeout issues that increasing the timeout often doesn't adequately resolve the issue due problems such as those mentioned above. |
neoneo008 said: Most of the places where I have encountered this issue was where the complete network of legacy devices & servers are in the same DMZ zone. This takes out routers & firewalls out the the communication network. Service design cannot be changed to asynchronous due to the nature of the third party systems. In such scenarios, for now at least we could have a workaround or a back-door API or a -d JAVA OPTION to temporarily fix this issue until the next major release & spec update. We could later rollback this back-door fix. |
gagordon said: |
gagordon said: public URL(URL context, String spec, URLStreamHandler handler) The URLStreamHandler would override its abstract and protected method openConnection(URL) on the URL it creates from the other parameters, thereby getting a URLConnection. The read and connect timeout parameters can then be set on the URLConnection created in openConnection() before the method returns. Therefore, it is best to not change anything in the current implementation and we can address the API in release 1.4. |
neoneo008 said: |
gagordon said: |
This issue was imported from java.net JIRA SAAJ-70 |
Is setting system properties
a possible workaround? These are the global defaults for URLConnection so they will affect more than just SAAJ, but this may still be acceptable. Documentation: Networking Properties. |
SAAJ uses URLConnection internally to make SOAP call. There is no way to set timeout for connection.call. This result is locked thread for over 10 mins.
From JDK 1.5 onwards URLConnection support setting of timeout for socket connection.
SAAJ lib should implement this timeout and provide an API to set the value of timeout.
Environment
linux
Affected Versions
[1.3]
The text was updated successfully, but these errors were encountered: