How to change default Java ROME parser socket timeout?

I am parsing a large number of RSS feeds in a cascade, using Java ROME as my XML parsing. Sometimes one of the RSS feeds may be unavailable due to network problems, which leads to a Socket timeout when trying to create an XMLReader object (new XMLReader (url)).

The problem is that the default timeout lasts about two decades, and when this happens, it slows down the whole process.

Is there a way to change the default socket timeout in Java ROME?

+5
source share
1 answer

XMLReader object ( new XMLReader(url)) URLConnection, XMLReader. setConnectTimeout(long) URLConnection . ,

+6

All Articles