Claus Ibsen created CAMEL-24272:
-----------------------------------

             Summary: Use BackgroundTask instead of ForegroundTask for 
reconnection loops so they are visible in internal tasks
                 Key: CAMEL-24272
                 URL: https://issues.apache.org/jira/browse/CAMEL-24272
             Project: Camel
          Issue Type: Improvement
            Reporter: Claus Ibsen


Several components use ForegroundTask for reconnection/retry loops that run in 
background threads. Because ForegroundTask blocks the calling thread and 
completes quickly per iteration, these retries are not visible in the 
internal-tasks dev console, CLI (camel get internal-task), or TUI Internal 
Tasks tab.

Switching to BackgroundTask would register these retries with the 
TaskManagerRegistry, letting operators observe reconnection attempts, retry 
count, delay, elapsed time, and errors.

Components to update:

* *camel-google-pubsub* - GooglePubsubConsumer: PubSub async-pull reconnection 
loop with 5s backoff runs in a background thread
* *camel-zookeeper* - ZooKeeperConsumer: reconnection backoff in background 
OperationsExecutor thread
* *camel-salesforce* - SubscriptionHelper: CometD handshake retry and subscribe 
retry delays in CometD listener background threads (2 usages)
* *camel-hazelcast* - HazelcastSedaConsumer: consumer error-recovery delay loop 
in background run() thread
* *camel-mongodb-gridfs* - GridFsConsumer: entire consumer polling loop 
implemented as unlimited ForegroundTask in a background executor (misuse of 
ForegroundTask)

See also CAMEL-24271 for the same issue in camel-kafka.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to