I am parsing a fair amount of RSS feeds in cascade using Java ROME as my XML parser. Sometimes one of the RSS feeds might be unreachable because of network issues, which results in a Socket timeout when trying to create the XMLReader object ( new XMLReader(url)).
The problem is that the default timeout lasts about 2 decades and when it happens it's slowing down the whole process.
Is there a way to change the default socket timeout in Java ROME?
When you create XMLReader object ( new XMLReader(url))
, you already have a URLConnection
object which is passed as the argument for XMLReader
. Call, setConnectTimeout(long)
of URLConnection and set your timeout value. I dont think Rome provides any connection timeout options
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With