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
How to change Java ROME parser default socket timeout?
Frage
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?
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow