You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "Croway (via GitHub)" <gi...@apache.org> on 2026/05/29 12:28:09 UTC
[PR] CAMEL-23646: Fix inverted BackgroundTask return values in sjms, pgevent and master [camel]
Croway opened a new pull request, #23639:
URL: https://github.com/apache/camel/pull/23639
## Summary
The `BackOff` → `BackgroundTask` migration (CAMEL-22206) preserved callback return values verbatim, but the two APIs have **opposite boolean semantics**: `BackOff` returns `false` to stop, `BackgroundTask` returns `true` to stop. This caused infinite retry loops after successful recovery in three components.
**camel-sjms/sjms2** — after a transient JMS connection interruption (reported with Oracle AQ), the consumer enters an infinite recovery loop. Each iteration destroys the working connection via `refreshConnection()` while `initConsumers()` skips re-creation (`consumers != null`), leaving consumers attached to closed sessions. Message consumption is permanently blocked.
**camel-pgevent** — after successful PostgreSQL reconnection, the task keeps calling `initConnection()` every `reconnectDelay`, leaking connections and duplicating notification listeners.
**camel-master** — after the delegated consumer starts, the task keeps calling `ServiceHelper.startService()` until budget exhaustion (default 10 iterations). Can revive a consumer after leadership loss.
## Changes
- `SimpleMessageListenerContainer.recoverConnection()`: `return false` → `return true`
- `SimpleMessageListenerContainer.scheduleConnectionRecovery()`: allow re-scheduling after a completed task (`!recoverTask.isRunning()`)
- `PgEventConsumer.PgEventListener.reconnect()`: `return false` → `return true`
- `MasterConsumer.onLeadershipTaken()`: `return false` → `return true`
- New test: `SjmsConnectionRecoveryTest` — uses ArtemisContainer (Testcontainers), simulates `onException`, verifies consumer resumes after recovery. Fails without fix, passes with fix.
## Test plan
- [x] `SjmsConnectionRecoveryTest` — fails without fix, passes with fix
- [ ] Existing `camel-sjms` test suite passes
- [ ] Existing `camel-master` test suite (20 tests) passes
- [ ] Existing `camel-pgevent` IT tests pass (require PostgreSQL Docker)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
_Claude Code on behalf of Federico Mariani_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23646: Fix inverted BackgroundTask return values in sjms, pgevent and master [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23639:
URL: https://github.com/apache/camel/pull/23639#issuecomment-4574982832
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23646: Fix inverted BackgroundTask return values in sjms, pgevent and master [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23639:
URL: https://github.com/apache/camel/pull/23639#issuecomment-4575288813
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `components/camel-master`
- `components/camel-pgevent`
- `components/camel-sjms`
<details><summary>All tested modules (20 modules)</summary>
- Camel :: AI :: LangChain4j :: Embedding
- Camel :: AI :: LangChain4j :: EmbeddingStore
- Camel :: Consul
- Camel :: Infinispan :: Embedded
- Camel :: Infinispan :: Remote
- Camel :: JBang :: MCP
- Camel :: JBang :: Plugin :: Route Parser
- Camel :: JBang :: Plugin :: TUI
- Camel :: JBang :: Plugin :: Validate
- Camel :: JGroups
- Camel :: JGroups Raft
- Camel :: Launcher :: Container
- Camel :: MLLP
- Camel :: Master
- Camel :: PgEvent
- Camel :: Simple JMS
- Camel :: Simple JMS2
- Camel :: YAML DSL :: Validator
- Camel :: YAML DSL :: Validator Maven Plugin
- Camel :: Zookeeper
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/26637438951)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23646: Fix inverted BackgroundTask return values in sjms, pgevent and master [camel]
Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway merged PR #23639:
URL: https://github.com/apache/camel/pull/23639
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org