Skip to content

IDEMPIERE-6989: Distributed Cache: Add Redis as alternative backend to Hazelcast - #24

Merged
d-ruiz merged 3 commits into
idempiere:mainfrom
PeterTakacs300:IDEMPIERE-6989
May 29, 2026
Merged

d-ruiz merged 3 commits into
idempiere:mainfrom
PeterTakacs300:IDEMPIERE-6989

Conversation

@PeterTakacs300

@PeterTakacs300 PeterTakacs300 commented May 18, 2026

Copy link
Copy Markdown
Contributor

ticket: https://idempiere.atlassian.net/browse/IDEMPIERE-6989

Summary by CodeRabbit

  • Documentation
    • Added guidance for configuring Redis as an optional distributed cache backend: installation and enablement steps, operational notes for container/rolling deployments, instance naming and key-prefixing behavior, and supported capabilities including caching (with optional near-cache), distributed locks, pub/sub (with optional durable streams), cluster membership, remote execution, resilience options, and diagnostic tips.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2fb3380b-5eaf-4a69-8404-215b2345dcb2

📥 Commits

Reviewing files that changed from the base of the PR and between b1e8822 and 2c4ee51.

📒 Files selected for processing (1)
  • docs/new-features/in-development/redis-distributed-cache.md
✅ Files skipped from review due to trivial changes (1)
  • docs/new-features/in-development/redis-distributed-cache.md

📝 Walkthrough

Walkthrough

This PR adds a new documentation page explaining Redis as an optional distributed cache backend for iDempiere, integrated via Redisson. The documentation covers the pluggable architecture, container deployment advantages, setup instructions, and supported capabilities including caching, locking, messaging, and resilience patterns.

Changes

Redis Distributed Cache Documentation

Layer / File(s) Summary
Feature overview and container deployment motivation
docs/new-features/in-development/redis-distributed-cache.md
Introduces the pluggable distributed cache interface, describes org.idempiere.redis.service (Redisson) as a Hazelcast alternative, and explains why Redis avoids partition rebalancing issues during container pod restarts.
Setup instructions and Redis backend capabilities
docs/new-features/in-development/redis-distributed-cache.md
Documents installation and configuration ($IDEMPIERE_HOME/redis.yaml, enable via -Didempiere.distributed.backend=redis or IDEMPIERE_DISTRIBUTED_BACKEND=redis), automatic key prefixing and instance-name resolution, and lists capabilities: caching primitives (optional Caffeine near-cache), distributed locks, pub/sub and optional Redis Streams, cluster heartbeat membership, topic-based remote execution, circuit-breaker resilience with optional local fallback, and OSGi diagnostics.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 I hopped through docs with ears held high,
Redis keeps the cache safe when pods say goodbye,
Locks and pub/sub, streams that gleam,
Near-cache hops fast — a developer's dream,
A little rabbit cheers the distributed scheme.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: adding Redis as an alternative backend to Hazelcast for the distributed cache system.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/new-features/in-development/redis-distributed-cache.md`:
- Around line 30-34: Clarify that swapping features with p2director
(uninstalling org.idempiere.hazelcast.service.feature.feature.group and
installing org.idempiere.redis.service.feature.feature.group) only changes
installed bundles but does not change the active backend at runtime; instruct
operators that to fully switch runtime backend they must set the JVM arg
-Didempiere.distributed.backend=redis (or environment
IDEMPIERE_DISTRIBUTED_BACKEND=redis) and restart iDempiere, and add a short note
that if both Hazelcast and Redis bundles remain installed the JVM/env setting
wins (Hazelcast stays active unless the backend is set to redis), plus remind
them to copy redis-template.yaml to $IDEMPIERE_HOME/redis.yaml and enable the
matching topology.
- Line 41: Update the Redisson RLock method name from the incorrect casing
"unLock" to the correct "unlock" everywhere in the doc line describing
distributed locks; specifically change the mention of tryLock / unLock to
tryLock / unlock to match the RLock API and java.util.concurrent.locks.Lock
naming convention.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1a17c250-f08e-463c-9b1a-4093cf50f765

📥 Commits

Reviewing files that changed from the base of the PR and between c77b759 and b1e8822.

📒 Files selected for processing (1)
  • docs/new-features/in-development/redis-distributed-cache.md

Comment thread docs/new-features/in-development/redis-distributed-cache.md Outdated
Comment thread docs/new-features/in-development/redis-distributed-cache.md Outdated
…tivation and fix unlock casing

Clarify that the JVM flag is required to activate the Redis bundle (installing
alone is not enough), and explain the no-cache-provider risk when Hazelcast is
uninstalled without setting the flag. Fix 'unLock' to 'unlock' to match the
Redisson RLock / java.util.concurrent.locks.Lock API.

**2. Swap the P2 feature.** Using p2director, uninstall `org.idempiere.hazelcast.service.feature.feature.group` and install `org.idempiere.redis.service.feature.feature.group`.

**3. Configure the connection.** Copy `redis-template.yaml` (bundled in `org.adempiere.server-feature`) to `$IDEMPIERE_HOME/redis.yaml` and uncomment the topology block that matches your setup. The template includes single-node, Sentinel, and Cluster examples with inline comments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step 1 and 2 above is wrong.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed the wrong steps

…review

Remove the p2director feature-swap step — org.idempiere.redis.service is
already included in org.adempiere.server-feature and ships with a standard
iDempiere installation. Both redis and hazelcast bundles coexist; selection
is controlled solely by -Didempiere.distributed.backend=redis.

Fix the redis-template.yaml path to $IDEMPIERE_HOME/redis-template.yaml
(it is already placed there by the product build, not sourced from the
feature bundle at runtime).
@d-ruiz
d-ruiz merged commit c8fc252 into idempiere:main May 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants