(jersey-common = 2.21.0, jackson-core = 2.6.1)
How to set HTTP timeouts (connect, read) if createParser (url url) was called? What are the default values?
JsonFactory jsonF = new JsonFactory(); jsonF.enable(JsonParser.Feature.AUTO_CLOSE_SOURCE); JsonParser jsonP = jsonF.createParser(url); // URL instance try { JsonToken token; while ( (token=jsonP.nextToken()) != null) { if (token == JsonToken.START_OBJECT) ..rest "json sax" parser code... } } finally { jsonP.close(); }
I have a recurring problem several times a week, when webapp stops reading json sources, the autorun task runs every 30 minutes. I suspect that this http call stops and starts to accumulate until the JVM drops.
Should the createParser function (URL) be used in production applications?
Whome source share