Claus Ibsen created CAMEL-27865:
-----------------------------------

             Summary: camel-twitter: filterOld has no effect on the search 
producer, type=direct breaks timeline consumers, geo search fails without 
distanceMetric
                 Key: CAMEL-27865
                 URL: https://issues.apache.org/jira/browse/CAMEL-27865
             Project: Camel
          Issue Type: Bug
          Components: camel-twitter
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-twitter for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31146).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. filterOld has no effect on the search producer
{{SearchProducer.process}}: getSinceId() is a primitive long (default 1), so 
query.sinceId(sinceId) always replaces the since id that filterOld set.
Proposed change: send sinceId only when filterOld is off or no last id is 
known, or keep the larger.

h4. 2. type=direct breaks timeline consumers
{{TwitterHelper.createConsumer}} skips setLastId for type=direct, so lastId 
stays -1 while the scheduler still polls: timeline polls fail in 
Paging.sinceId(-1) ("since_id should be positive integer"), and a list timeline 
(UserListConsumerHandler.doDirect, Paging.ofSinceId(-1)) never works.
Proposed change: initialise lastId in both modes, and do not schedule polls in 
direct mode.

h4. 3. Geo search fails without distanceMetric
distanceMetric has defaultValue "km" but the field is null; with latitude, 
longitude and radius set, {{SearchConsumerHandler.search}} calls 
Unit.valueOf(null) and fails on every poll.
Proposed change: initialise the field to "km".

h4. 4. count is dropped for timeline polling
{{AbstractTwitterConsumerHandler.getLastIdPaging}} drops count when 
numberOfPages is null, and numberOfPages is used as the page number.
Proposed change: keep count, and document the page number.

h4. 5. httpProxyHost without httpProxyPort fails late
{{TwitterConfiguration.buildTwitter}} passes port -1, and twitter4j fails with 
IllegalArgumentException on the first call.
Proposed change: validate at endpoint creation.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to