ammachado opened a new pull request, #31222: URL: https://github.com/apache/camel/pull/31222
# Description [CAMEL-27982](https://issues.apache.org/jira/browse/CAMEL-27982): `SpringRedisIdempotentRepository.clear()` (also the `clear` JMX operation) ran `FLUSHDB`, which deleted every key of the selected Redis database, not only the data of this repository. It also took a connection from the connection factory and never released it. The ids of this repository are the members of a single Redis set named `repositoryName` (`SADD` / `SISMEMBER` / `SREM`), so `clear()` now deletes that one key with `redisTemplate.delete(repositoryName)`. `RedisTemplate` borrows and releases the connection itself. - `flushOnStartup` is unchanged on purpose: it is an explicit opt-in documented as deleting all keys of the database. - The unit test now checks that only the repository's set is deleted and that `FLUSHDB` is never run. - The 4.25 upgrade guide describes the behavior change. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. Not from the root folder: I ran `mvn formatter:format impsort:sort` and `mvn test -Dtest=SpringRedisIdempotentRepositoryTest` in `components/camel-spring-parent/camel-spring-redis` (10 tests, 0 failures). No generated files are affected: no option, annotation or description changed. # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. 🤖 Generated with [Claude Code](https://claude.com/claude-code) on behalf of Adriano Machado (@ammachado) _This was generated by an AI agent and may contain inaccuracies. Please verify before relying on it._ -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
