Claus Ibsen created CAMEL-26715:
-----------------------------------

             Summary: camel-core - Polling consumers: keep when a poll last 
found something, and when it last polled
                 Key: CAMEL-26715
                 URL: https://issues.apache.org/jira/browse/CAMEL-26715
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
            Reporter: Claus Ibsen
             Fix For: 4.24.0


A route from a polling consumer (file, ftp, sql, jpa, timer-less scheduled 
polls ...) that has nothing to do looks the same as one that is stuck: no 
exchanges. Today ScheduledPollConsumer counts the polls (counter) and the 
successful and failed polls in a row (successCounter, errorCounter), and has an 
idle counter for the backoff, but it does not keep *when* a poll last found 
something.

A count of empty polls does not help much: without the delay of the consumer 
you cannot tell if 123 empty polls is two minutes or twelve seconds (delay=500, 
delay=100, ...). A time does help: "the last poll that found something was 47s 
ago", next to "the last poll was 0.5s ago" (so the scheduler is alive).

Proposal:

* ScheduledPollConsumer keeps the time of the last poll, and the time of the 
last poll that polled messages (and how many it polled then).
* Exposed on ManagedScheduledPollConsumerMBean and in the consumer dev console.
* The timeline dev console (CAMEL-26691) and the Timeline/About screens of the 
TUI (CAMEL-26700) use it for a polling route that is quiet: "polled nothing for 
47s, last poll 0.5s ago" instead of an idle route, and a scheduler that stopped 
polling stands out.

Raised on the walk of the Timeline without chaos (an idea from the CAMEL-26691 
walk).

_Claude Code on behalf of Claus Ibsen_



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

Reply via email to