[
https://issues.apache.org/jira/browse/CAMEL-27887?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-27887:
--------------------------------
Description:
Found while improving the option descriptions of camel-rss for CAMEL-23832
(commit
https://github.com/apache/camel/commit/85ea55b80e9f710e1c415febdbba3bc65915daea,
pull request https://github.com/apache/camel/pull/31155).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. No connect or read timeout
{{RssUtils.createSyndFeed}} uses new XmlReader(URI.create(feedUri).toURL()),
which opens a URLConnection without timeouts, so a server that does not answer
blocks the poll thread forever (unless the sun.net.client.default*Timeout
properties are set). The XmlReader(URL) constructor is also deprecated in ROME
2.x.
Proposed change: open the URLConnection with timeouts (perhaps as new options)
and pass its stream to SyndFeedInput.
h4. 2. The data format uses the platform charset
{{RssDataFormat.marshal}} writes xml.getBytes(), while SyndFeedOutput writes
the prolog with the feed encoding, so a feed with its encoding set gets a
prolog that does not match its bytes.
Proposed change: encode with feed.getEncoding(), else UTF-8.
h4. 3. Different TCCL in the two consumers
RssEntryPollingConsumer reads the feed with its own class loader as TCCL,
RssPollingConsumer with the caller TCCL.
_Claude Code on behalf of davsclaus_
was:
Found while improving the option descriptions of camel-rss for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31155).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. No connect or read timeout
{{RssUtils.createSyndFeed}} uses new XmlReader(URI.create(feedUri).toURL()),
which opens a URLConnection without timeouts, so a server that does not answer
blocks the poll thread forever (unless the sun.net.client.default*Timeout
properties are set). The XmlReader(URL) constructor is also deprecated in ROME
2.x.
Proposed change: open the URLConnection with timeouts (perhaps as new options)
and pass its stream to SyndFeedInput.
h4. 2. The data format uses the platform charset
{{RssDataFormat.marshal}} writes xml.getBytes(), while SyndFeedOutput writes
the prolog with the feed encoding, so a feed with its encoding set gets a
prolog that does not match its bytes.
Proposed change: encode with feed.getEncoding(), else UTF-8.
h4. 3. Different TCCL in the two consumers
RssEntryPollingConsumer reads the feed with its own class loader as TCCL,
RssPollingConsumer with the caller TCCL.
_Claude Code on behalf of davsclaus_
> camel-rss: the feed is read without timeouts, the data format writes with the
> platform charset
> ----------------------------------------------------------------------------------------------
>
> Key: CAMEL-27887
> URL: https://issues.apache.org/jira/browse/CAMEL-27887
> Project: Camel
> Issue Type: Bug
> Components: camel-rss
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-rss for CAMEL-23832
> (commit
> https://github.com/apache/camel/commit/85ea55b80e9f710e1c415febdbba3bc65915daea,
> pull request https://github.com/apache/camel/pull/31155).
> These are separate problems of the component; the descriptions change only
> documents the current behavior.
> h4. 1. No connect or read timeout
> {{RssUtils.createSyndFeed}} uses new XmlReader(URI.create(feedUri).toURL()),
> which opens a URLConnection without timeouts, so a server that does not
> answer blocks the poll thread forever (unless the
> sun.net.client.default*Timeout properties are set). The XmlReader(URL)
> constructor is also deprecated in ROME 2.x.
> Proposed change: open the URLConnection with timeouts (perhaps as new
> options) and pass its stream to SyndFeedInput.
> h4. 2. The data format uses the platform charset
> {{RssDataFormat.marshal}} writes xml.getBytes(), while SyndFeedOutput writes
> the prolog with the feed encoding, so a feed with its encoding set gets a
> prolog that does not match its bytes.
> Proposed change: encode with feed.getEncoding(), else UTF-8.
> h4. 3. Different TCCL in the two consumers
> RssEntryPollingConsumer reads the feed with its own class loader as TCCL,
> RssPollingConsumer with the caller TCCL.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)