You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/10/18 16:02:30 UTC
[camel] 06/45: CAMEL-12880 : Atom consumer stops polling
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git
commit ffcf34abf2b9a000ffe646f7c80636833f69c6fb
Author: Saravanakumar Selvaraj <sa...@gmail.com>
AuthorDate: Sun Oct 14 21:12:23 2018 +0530
CAMEL-12880 : Atom consumer stops polling
---
.../src/main/java/org/apache/camel/component/atom/AtomUtils.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomUtils.java b/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomUtils.java
index 0571cd8..5b1875a8 100644
--- a/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomUtils.java
+++ b/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomUtils.java
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
+import java.net.URLConnection;
import org.apache.abdera.Abdera;
import org.apache.abdera.model.Document;
@@ -53,7 +54,11 @@ public final class AtomUtils {
* @throws ParseException is thrown if the parsing failed
*/
public static Document<Feed> parseDocument(String uri) throws IOException, ParseException {
- InputStream in = new URL(uri).openStream();
+ URL feedUrl = new URL(uri);
+ URLConnection urlConn = feedUrl.openConnection();
+ urlConn.setConnectTimeout(60000);
+ urlConn.setReadTimeout(60000);
+ InputStream in = urlConn.getInputStream();
return parseInputStream(in);
}