[
https://issues.apache.org/jira/browse/CAMEL-27842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-27842:
--------------------------------
Description:
Found while improving the option descriptions of camel-atom for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31143).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. The default poll delay is 500 ms
{{FeedEndpoint.createConsumer}} calls setDelay(60000) and then
configureConsumer(answer); ScheduledPollEndpoint.doConfigureConsumer sets the
delay to DEFAULT_DELAY (500 ms) because the endpoint delay is -1. A test shows
getDelay() = 500 for both consumer types, while the doc page says the feed is
polled every 60 seconds by default.
Proposed change: override getDefaultDelay() (and have doConfigureConsumer use
it), or set the endpoint delay to 60000 when it is not set.
h4. 2. The default idempotent strategy ignores the time zone offset
{{ItemUpdatedIdempotentStrategy}} compares dates parsed by AtomConverter.toDate
(SimpleDateFormat yyyy-MM-dd'T'HH:mm:ss), which drops the offset and reads the
time in the JVM zone. An entry updated 2024-01-01T09:30:00-01:00 (newer) after
one updated 2024-01-01T10:00:00Z is skipped for good (reproduced). RFC 822 and
date-only values do not parse, so those entries are routed on every poll.
Proposed change: compare the ZonedDateTime of the library (updated, else
published).
h4. 3. camel-rss, which shares FeedEndpoint (found while fixing the shared
texts)
* RSS has no idempotent check: each read of the feed routes all entries again,
also those routed before (older Camel had a lastUpdate filter for RSS).
* {{RssDateComparator}} returns 0 when either entry has no date, which is not a
consistent ordering for List.sort.
* With sortEntries, RSS sorts the entries list of the SyndFeed in place, so the
CamelRssFeed header shows the sorted order.
* {{FeedEndpoint.createEndpointUri}} returns "atom:" + feedUri for RSS
endpoints too.
* The CamelRssFeed header text says SyncFeed instead of SyndFeed.
_Claude Code on behalf of davsclaus_
was:
Found while improving the option descriptions of camel-atom for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31143).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. The default poll delay is 500 ms
{{FeedEndpoint.createConsumer}} calls setDelay(60000) and then
configureConsumer(answer); ScheduledPollEndpoint.doConfigureConsumer sets the
delay to DEFAULT_DELAY (500 ms) because the endpoint delay is -1. A test shows
getDelay() = 500 for both consumer types, while the doc page says the feed is
polled every 60 seconds by default.
Proposed change: override getDefaultDelay() (and have doConfigureConsumer use
it), or set the endpoint delay to 60000 when it is not set.
h4. 2. The default idempotent strategy ignores the time zone offset
{{ItemUpdatedIdempotentStrategy}} compares dates parsed by AtomConverter.toDate
(SimpleDateFormat yyyy-MM-dd'T'HH:mm:ss), which drops the offset and reads the
time in the JVM zone. An entry updated 2024-01-01T09:30:00-01:00 (newer) after
one updated 2024-01-01T10:00:00Z is skipped for good (reproduced). RFC 822 and
date-only values do not parse, so those entries are routed on every poll.
Proposed change: compare the ZonedDateTime of the library (updated, else
published).
_Claude Code on behalf of davsclaus_
> camel-atom: the default poll delay is 500 ms instead of 60 s, the idempotent
> strategy ignores the time zone offset
> ------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-27842
> URL: https://issues.apache.org/jira/browse/CAMEL-27842
> Project: Camel
> Issue Type: Bug
> Components: camel-atom
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-atom for CAMEL-23832
> (pull request https://github.com/apache/camel/pull/31143).
> These are separate problems of the component; the descriptions change only
> documents the current behavior.
> h4. 1. The default poll delay is 500 ms
> {{FeedEndpoint.createConsumer}} calls setDelay(60000) and then
> configureConsumer(answer); ScheduledPollEndpoint.doConfigureConsumer sets the
> delay to DEFAULT_DELAY (500 ms) because the endpoint delay is -1. A test
> shows getDelay() = 500 for both consumer types, while the doc page says the
> feed is polled every 60 seconds by default.
> Proposed change: override getDefaultDelay() (and have doConfigureConsumer use
> it), or set the endpoint delay to 60000 when it is not set.
> h4. 2. The default idempotent strategy ignores the time zone offset
> {{ItemUpdatedIdempotentStrategy}} compares dates parsed by
> AtomConverter.toDate (SimpleDateFormat yyyy-MM-dd'T'HH:mm:ss), which drops
> the offset and reads the time in the JVM zone. An entry updated
> 2024-01-01T09:30:00-01:00 (newer) after one updated 2024-01-01T10:00:00Z is
> skipped for good (reproduced). RFC 822 and date-only values do not parse, so
> those entries are routed on every poll.
> Proposed change: compare the ZonedDateTime of the library (updated, else
> published).
> h4. 3. camel-rss, which shares FeedEndpoint (found while fixing the shared
> texts)
> * RSS has no idempotent check: each read of the feed routes all entries
> again, also those routed before (older Camel had a lastUpdate filter for RSS).
> * {{RssDateComparator}} returns 0 when either entry has no date, which is not
> a consistent ordering for List.sort.
> * With sortEntries, RSS sorts the entries list of the SyndFeed in place, so
> the CamelRssFeed header shows the sorted order.
> * {{FeedEndpoint.createEndpointUri}} returns "atom:" + feedUri for RSS
> endpoints too.
> * The CamelRssFeed header text says SyncFeed instead of SyndFeed.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)