Skip to content

Conversation

@sanjomo
Copy link
Member

@sanjomo sanjomo commented Jan 1, 2026

Description

Storefactory api final 4.0.0

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Test improvements
  • Build/tooling changes

Related Issue

Closes #(issue number)

Changes Made

Testing

  • All existing tests pass
  • New tests added for new functionality
  • Tests pass locally with mvn test
  • Integration tests pass (if applicable)

Checklist

  • Code follows project coding standards
  • Self-review completed
  • Code is commented where necessary
  • Documentation updated (if needed)
  • Commit messages follow conventional format
  • No merge conflicts
  • All CI checks pass

Additional Notes

Any additional information, screenshots, or context that reviewers should know.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added null-safety checks across store factory APIs.
    • New convenience constructors for store factories with sensible default configurations.
    • Introduced eventStore() method to expose configured event store instances.
  • Bug Fixes

    • Improved shutdown error handling with logging instead of exception propagation.
  • Refactor

    • Renamed store factory and event store classes for clarity and consistency across Redis and Hazelcast integrations.
    • Enhanced factory documentation and debugging output via toString() methods.

✏️ Tip: You can customize this high-level summary in your review settings.

Enhanced HazelcastStoreFactory, MemoryStoreFactory, and RedissonStoreFactory to allow explicit injection of custom EventStore implementations. Updated constructors, improved Javadoc, and clarified default behaviors for each factory. This enables hybrid configurations where session storage and event propagation backends can be mixed and matched independently.
@sanjomo sanjomo self-assigned this Jan 1, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 1, 2026

📝 Walkthrough

Walkthrough

This PR refactors store and event-store implementations across the codebase. Key changes include renaming Hazelcast and Redis event-store classes (adding "PubSub" prefix for clarity), introducing new store factory constructors supporting pluggable EventStore injection with @NotNull annotations for null-safety, adding eventStore() and toString() methods, and updating shutdown semantics to wrap EventStore shutdown calls in try-catch with error logging.

Changes

Cohort / File(s) Summary
Hazelcast Event Store Renames
HazelcastPubSubEventStore.java, HazelcastPubSubRingBufferEventStore.java
Class and constructor names updated (HazelcastEventStore → HazelcastPubSubEventStore; HazelcastRingBufferEventStore → HazelcastPubSubRingBufferEventStore); builder method return types and logger references updated accordingly.
Redis Event Store Renames
RedisPubSubEventStore.java, RedisPubSubReliableEventStore.java, RedisStore.java
Classes renamed (RedissonEventStore → RedisPubSubEventStore; RedissonReliableEventStore → RedisPubSubReliableEventStore; RedissonStore → RedisStore); constructors, loggers, and builder instantiations updated to reflect new names.
Store Factory Enhancements
HazelcastStoreFactory.java, MemoryStoreFactory.java, RedissonStoreFactory.java
Added @NotNull annotations and enforced null-safety on parameters; introduced overloaded constructors supporting both custom EventStore and default EventStore injection; added eventStore() and toString() methods; updated shutdown to wrap calls in try-catch with error logging.
New Redis Store Factory
RedisStoreFactory.java
New public class replacing/accompanying RedissonStoreFactory; provides two constructors (with custom EventStore or defaulting to RedisPubSubEventStore), createStore(UUID), eventStore(), createMap(String), shutdown(), and toString() methods with full null-safety enforcement.
Configuration Updates
Configuration.java
Import and Javadoc references updated from RedissonStoreFactory to RedisStoreFactory; no method signatures altered.
Hazelcast Integration Tests
DistributedHazelcast*.java, HazelcastStoreFactoryTest.java, HazelcastRingBufferEventStoreTest.java
Imports and builder instantiations updated to use HazelcastPubSubEventStore and HazelcastPubSubRingBufferEventStore; test assertions and type checks updated accordingly.
Redis Integration Tests
DistributedRedissonPubSub*.java, DistributedRedissonReliable*.java, DistributedRedissonStream*.java, DistributedKafka*.java, RedissonReliableStoreFactoryTest.java, RedissonStoreTest.java, RedisPubSubEventStoreTest.java
Imports updated from Redisson* to Redis* classes (RedisStoreFactory, RedisPubSubEventStore, RedisPubSubReliableEventStore, RedisStore); factory instantiations and builder references updated; test class renames and type assertions adjusted to new public API.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement, refactoring

Suggested reviewers

  • NeatGuyCoding

Poem

🐰 The stores are renamed, the factories shine bright,
With EventStore wired just right,
Null-safety guards keep the code sound,
PubSub clarity all around! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete. The required template sections (Changes Made, Related Issue, Testing, Checklist) contain only placeholders or empty bullet points with no actual details about the refactoring work performed. Complete all template sections with concrete details: describe the renaming changes, link related issues, verify test status, confirm checklist items, and provide context for the 4.0.0 API finalization.
Docstring Coverage ⚠️ Warning Docstring coverage is 36.62% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title "Storefactory api final 4.0.0" is overly vague and generic. It fails to clearly communicate the primary changes made in the PR beyond a version reference. Revise the title to be more specific and descriptive (e.g., 'Rename Redis/Hazelcast store factories and event stores to remove Redisson/Hazelcast prefix naming' or 'Refactor store factory public API with null-safety and naming consistency').
✨ Finishing touches
  • 📝 Generate docstrings

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.

@sanjomo sanjomo requested a review from NeatGuyCoding January 1, 2026 08:46
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/memory/MemoryStoreFactory.java (1)

45-45: Consider making the field final for immutability.

The eventStore field is assigned only in constructors and never modified afterward. Marking it final would enforce immutability and make the intent clearer.

🔎 Proposed fix
-    private final EventStore eventStore;
+    private final EventStore eventStore;

Actually, looking at the code again, I see the field is already implicitly immutable. Let me correct this - the field should be explicitly marked final:

-    private EventStore eventStore;
+    private final EventStore eventStore;
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (2)

96-103: Consider documenting or handling hazelcastClient lifecycle.

The shutdown only closes the eventStore, not the hazelcastClient. If the Hazelcast instance is externally managed (i.e., provided by the caller), this is correct behavior—but it would help to document this expectation in the class Javadoc.

Also, catching and swallowing exceptions prevents callers from knowing if shutdown failed. Consider logging at warn level if this is expected, or re-throwing as a wrapped exception if failures should be surfaced.


110-113: Consider enriching toString() for debugging.

Including the EventStore implementation type would aid debugging in mixed configurations.

🔎 Suggested enhancement
 @Override
 public String toString() {
-    return getClass().getSimpleName() + " (Hazelcast session store)";
+    return getClass().getSimpleName() + " (Hazelcast session store, eventStore=" 
+           + eventStore.getClass().getSimpleName() + ")";
 }
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedissonStoreFactory.java (1)

168-171: Consider including eventStore type in toString() for debugging.

The current output omits the event store configuration. Including it could aid troubleshooting in multi-factory deployments.

🔎 Optional enhancement
 @Override
 public String toString() {
-    return getClass().getSimpleName() + " (redis session store)";
+    return getClass().getSimpleName() + " (redis session store, eventStore=" 
+           + eventStore.getClass().getSimpleName() + ")";
 }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a742612 and 781210b.

📒 Files selected for processing (3)
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/memory/MemoryStoreFactory.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedissonStoreFactory.java
🧰 Additional context used
🧬 Code graph analysis (2)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/event/BaseStoreFactory.java (1)
  • BaseStoreFactory (37-245)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/memory/MemoryStoreFactory.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/event/BaseStoreFactory.java (1)
  • BaseStoreFactory (37-245)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build (25) / build
  • GitHub Check: build (21) / build
  • GitHub Check: build (17) / build
  • GitHub Check: qodana
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (12)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/memory/MemoryStoreFactory.java (4)

30-42: Excellent documentation!

The class-level Javadoc clearly explains the separation between session storage and event propagation, with helpful examples of different combinations. This will greatly assist users in understanding the architecture.


47-54: LGTM!

The default constructor is well-documented and correctly initializes with a MemoryEventStore for local-only operation.


81-83: LGTM - appropriate for memory storage.

The no-op implementation is correct since memory-based storage has no external resources to clean up.


90-93: Helpful addition for debugging!

The toString() override provides clear identification of the factory type and storage mechanism, which will be useful for logging and debugging.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (3)

55-69: LGTM!

Good defensive programming with both @NotNull annotations for static analysis hints and Objects.requireNonNull for runtime validation. The Javadoc is clear and complete.


91-94: LGTM!

Correctly implements the abstract eventStore() method required by BaseStoreFactory.


81-84: No action required — the HazelcastEventStore constructor is designed to handle null values and empty strings safely.

The constructor accepts @Nullable parameters for nodeId, eventStoreMode, and topicPrefix. It applies appropriate defaults:

  • Null eventStoreMode defaults to MULTI_CHANNEL (line 72)
  • Null or empty topicPrefix defaults to DEFAULT_TOPIC_NAME_PREFIX (lines 66–68)
  • Null nodeId defaults via getNodeId() (line 79)

The Javadoc claim of MULTI_CHANNEL mode is accurate.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedissonStoreFactory.java (5)

33-105: Excellent documentation.

The Javadoc provides comprehensive guidance including use cases, lifecycle notes, thread-safety considerations, and suitability assessments. This is helpful for API consumers choosing the appropriate store factory configuration.


124-128: Good defensive null-safety.

Combining @NotNull annotations with Objects.requireNonNull runtime checks provides both static analysis hints and runtime enforcement. This is a sound pattern for public API constructors.


155-157: LGTM.

Clean delegation to Redisson's map creation. The generic typing provides flexibility for different key-value types.


160-166: Graceful shutdown handling.

Wrapping eventStore.shutdown() in try-catch with logging is appropriate for lifecycle methods. This prevents shutdown failures from propagating and potentially blocking other cleanup. The decision to not close redisClient aligns with the documented contract that Redis connections are managed externally.


139-142: No issue identified. The nodeId parameter is explicitly annotated as @Nullable Long and the constructor properly handles null by generating a default value via getNodeId() (line 75-76). Passing null is intentional and safe.

Likely an incorrect or invalid review comment.

@github-actions
Copy link

github-actions bot commented Jan 1, 2026

Qodana for JVM

57 new problems were found

Inspection name Severity Problems
Vulnerable declared dependency 🔶 Warning 9
Comparison of 'short' and 'char' values 🔶 Warning 2
Result of method call ignored 🔶 Warning 2
Pointless arithmetic expression 🔶 Warning 2
AutoCloseable used without 'try'-with-resources 🔶 Warning 1
Busy wait 🔶 Warning 1
Injection point with ambiguous dependencies 🔶 Warning 1
Number of placeholders does not match number of arguments in logging call 🔶 Warning 1
Unnecessary 'null' check before method call 🔶 Warning 1
Wrapper type may be primitive 🔶 Warning 1
Non-distinguishable logging calls ◽️ Notice 27
Vulnerable declared dependency ◽️ Notice 9

☁️ View the detailed Qodana report

Detected 124 dependencies

Third-party software list

This page lists the third-party software dependencies used in project

Dependency Version Licenses
aesh 2.8.2 Apache-2.0
annotations 26.0.2-1 Apache-2.0
arc-processor 3.30.5 Apache-2.0
arc 3.30.5 Apache-2.0
asm-analysis 9.9 BSD-3-Clause
asm-commons 9.9 BSD-3-Clause
asm-tree 9.9 BSD-3-Clause
asm-util 9.9 BSD-3-Clause
asm 9.9 BSD-3-Clause
byte-buddy 1.18.2 Apache-2.0
cache-api 1.1.1 Apache-2.0
commons-codec 1.20.0 Apache-2.0
commons-compress 1.28.0 Apache-2.0
commons-io 2.21.0 Apache-2.0
commons-logging-jboss-logging 1.0.0.final Apache-2.0
commons-logging 1.3.5 Apache-2.0
crac 1.5.0 BSD-2-Clause
gizmo 1.9.0 Apache-2.0
gizmo2 2.0.0.beta10 Apache-2.0
hazelcast 5.2.5 MIT
jackson-annotations 2.20 Apache-2.0
jackson-core 2.20.1 Apache-2.0
jackson-databind 2.20.1 Apache-2.0
jakarta.annotation-api 2.1.1 Classpath-exception-2.0
EPL-2.0
GPL-2.0-only
jakarta.annotation-api 3.0.0 Classpath-exception-2.0
EPL-2.0
GPL-2.0-only
jakarta.el-api 6.0.1 Classpath-exception-2.0
EPL-2.0
GPL-2.0-only
jakarta.enterprise.cdi-api 4.1.0 Apache-2.0
jakarta.enterprise.lang-model 4.1.0 Apache-2.0
jakarta.inject-api 2.0.1 Apache-2.0
jakarta.interceptor-api 2.2.0 Classpath-exception-2.0
EPL-2.0
GPL-2.0-only
jakarta.json-api 2.1.3 Classpath-exception-2.0
EPL-2.0
GPL-2.0-only
jakarta.transaction-api 2.0.1 Classpath-exception-2.0
EPL-2.0
GPL-2.0-only
jandex-gizmo2 3.5.2 Apache-2.0
jandex 3.5.2 Apache-2.0
jansi 2.4.0 Apache-2.0
jboss-logging 3.6.1.final Apache-2.0
jboss-logmanager 3.1.2.final Apache-2.0
jboss-threads 3.9.2 Apache-2.0
jctools-core 4.0.5 Apache-2.0
jdk-classfile-backport 25.1 GPL-2.0-only
jodd-util 6.3.0 BSD-2-Clause
jspecify 1.0.0 Apache-2.0
jul-to-slf4j 2.0.17 MIT
kafka-clients 4.1.1 Apache-2.0
kryo 5.6.2 BSD-3-Clause
log4j-api 2.25.3 Apache-2.0
log4j-to-slf4j 2.25.3 Apache-2.0
lz4-java 1.8.0 Apache-2.0
micrometer-commons 1.16.1 Apache-2.0
micrometer-observation 1.16.1 Apache-2.0
micronaut-aop 4.10.2 Apache-2.0
micronaut-context-propagation 4.10.2 Apache-2.0
micronaut-context 4.10.2 Apache-2.0
micronaut-core-reactive 4.10.2 Apache-2.0
micronaut-core 4.10.2 Apache-2.0
micronaut-discovery-core 4.10.2 Apache-2.0
micronaut-http-server 4.10.2 Apache-2.0
micronaut-http 4.10.2 Apache-2.0
micronaut-inject 4.10.2 Apache-2.0
micronaut-retry 4.10.2 Apache-2.0
micronaut-router 4.10.2 Apache-2.0
micronaut-runtime 4.10.2 Apache-2.0
microprofile-config-api 3.1 Apache-2.0
microprofile-context-propagation-api 1.3 Apache-2.0
minlog 1.3.1 BSD-3-Clause
mutiny 3.1.0 Apache-2.0
nativeimage 23.1.2 UPL-1.0
netty-common 4.2.9.final Apache-2.0
parsson 1.1.7 Classpath-exception-2.0
EPL-2.0
GPL-2.0-only
quarkus-arc-deployment 3.30.5 Apache-2.0
quarkus-arc-dev 3.30.5 Apache-2.0
quarkus-arc 3.30.5 Apache-2.0
quarkus-bootstrap-app-model 3.30.5 Apache-2.0
quarkus-bootstrap-core 3.30.5 Apache-2.0
quarkus-bootstrap-runner 3.30.5 Apache-2.0
quarkus-builder 3.30.5 Apache-2.0
quarkus-class-change-agent 3.30.5 Apache-2.0
quarkus-classloader-commons 3.30.5 Apache-2.0
quarkus-core-deployment 3.30.5 Apache-2.0
quarkus-core 3.30.5 Apache-2.0
quarkus-development-mode-spi 3.30.5 Apache-2.0
quarkus-devui-deployment-spi 3.30.5 Apache-2.0
quarkus-fs-util 1.2.0 Apache-2.0
quarkus-hibernate-validator-spi 3.30.5 Apache-2.0
quarkus-ide-launcher 3.30.5 Apache-2.0
quarkus-smallrye-context-propagation-spi 3.30.5 Apache-2.0
reactive-streams 1.0.4 MIT-0
reactor-core 3.6.2 Apache-2.0
reactor-core 3.7.9 Apache-2.0
readline 2.6 Apache-2.0
redisson 4.0.0 Apache-2.0
reflectasm 1.11.9 BSD-3-Clause
rxjava 3.1.8 Apache-2.0
slf4j-api 2.0.17 MIT
slf4j-jboss-logmanager 2.0.2.final Apache-2.0
smallrye-common-annotation 2.14.0 Apache-2.0
smallrye-common-classloader 2.14.0 Apache-2.0
smallrye-common-constraint 2.14.0 Apache-2.0
smallrye-common-cpu 2.14.0 Apache-2.0
smallrye-common-expression 2.14.0 Apache-2.0
smallrye-common-function 2.14.0 Apache-2.0
smallrye-common-io 2.14.0 Apache-2.0
smallrye-common-net 2.14.0 Apache-2.0
smallrye-common-os 2.14.0 Apache-2.0
smallrye-common-process 2.14.0 Apache-2.0
smallrye-common-ref 2.14.0 Apache-2.0
smallrye-common-resource 2.14.0 Apache-2.0
smallrye-config-common 3.14.1 Apache-2.0
smallrye-config-core 3.14.1 Apache-2.0
smallrye-config 3.14.1 Apache-2.0
snakeyaml 2.5 Apache-2.0
snappy-java 1.1.10.7 Apache-2.0
spring-aop 7.0.2 Apache-2.0
spring-beans 7.0.2 Apache-2.0
spring-boot-autoconfigure 4.0.1 Apache-2.0
spring-boot-starter-logging 4.0.1 Apache-2.0
spring-boot-starter 4.0.1 Apache-2.0
spring-boot 4.0.1 Apache-2.0
spring-context 7.0.2 Apache-2.0
spring-core 7.0.2 Apache-2.0
spring-expression 7.0.2 Apache-2.0
wildfly-common 2.0.1 Apache-2.0
word 23.1.2 UPL-1.0
zstd-jni 1.5.6-10 BSD-2-Clause
Contact Qodana team

Contact us at qodana-support@jetbrains.com

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (1)

55-69: Approve with minor javadoc formatting suggestion.

The null safety implementation is solid with both @NotNull annotations and runtime checks using Objects.requireNonNull.

Minor: Line 59 and Line 77 have a spacing issue in @apiNote Added in API version{@code 4.0.0} – consider adding a space before {@code.

🔎 Proposed formatting fix
-     * @apiNote Added in API version{@code 4.0.0}
+     * @apiNote Added in API version {@code 4.0.0}
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 781210b and 3ee3f12.

📒 Files selected for processing (2)
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedissonStoreFactory.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build (25) / build
  • GitHub Check: build (21) / build
  • GitHub Check: build (17) / build
  • GitHub Check: qodana
🔇 Additional comments (11)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (6)

23-23: LGTM!

The new imports support the @NotNull annotations and EventStoreMode documentation reference.

Also applies to: 30-31


34-47: LGTM!

The expanded javadoc clearly documents the hybrid configuration capability and default behavior.


92-94: LGTM!

The eventStore() accessor properly exposes the configured EventStore, enabling consumers to inspect the event distribution strategy.


97-103: LGTM!

The resilient shutdown pattern prevents cascading failures during cleanup. Catching and logging exceptions without propagating them is appropriate for lifecycle methods, ensuring that other cleanup operations can proceed even if the EventStore shutdown fails.


110-114: LGTM!

The toString() override provides a clear, informative representation for debugging and logging purposes.


71-84: The HazelcastEventStore instantiation is correct as-is.

The constructor accepts (hazelcastPub, hazelcastSub, nodeId, eventStoreMode, topicPrefix) where the first two require non-null HazelcastInstance parameters and the remaining three are @Nullable. Passing the same hazelcastClient instance for both pub and sub parameters is intentional—they represent different logical roles (publishing vs. subscribing). The null values for nodeId and eventStoreMode are explicitly allowed by their @Nullable annotations. The empty string for topicPrefix is properly handled by the constructor's logic (line 66-67), which treats it identically to null and substitutes DEFAULT_TOPIC_NAME_PREFIX. No changes are needed.

Likely an incorrect or invalid review comment.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedissonStoreFactory.java (5)

33-105: Excellent comprehensive documentation!

The JavaDoc is thorough, well-structured, and provides clear guidance on usage patterns, lifecycle, thread safety, and suitability. The examples and hybrid topology explanations add significant value for users.


114-128: LGTM! Proper null-safety enforcement.

The @NotNull annotations combined with Objects.requireNonNull provide good defensive programming. The parameter rename to redisClient improves consistency with the field name.


155-157: LGTM! Correct delegation to Redisson API.

The method properly delegates to the Redisson client's getMap method for creating Redis-backed maps.


160-166: LGTM! Appropriate exception handling for shutdown.

The try-catch pattern ensures shutdown failures don't propagate, which is appropriate for lifecycle cleanup. The broad Exception catch provides maximum resilience during shutdown, aligning with similar patterns in HazelcastStoreFactory and MemoryStoreFactory.


168-171: LGTM! Clear and concise toString implementation.

The toString method provides a helpful description for logging and debugging purposes.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (2)

55-69: Minor: Fix javadoc formatting.

The @apiNote has a formatting inconsistency with version{@code 4.0.0} (missing space before {).

🔎 Suggested fix
-     * @apiNote Added in API version{@code 4.0.0}
+     * @apiNote Added in API version {@code 4.0.0}

Otherwise, the constructor implementation with null checks and @NotNull annotations is excellent.


92-94: Add @NotNull annotation to the return type.

Since the eventStore field is guaranteed non-null (validated in the constructor), the eventStore() method should be annotated with @NotNull for API clarity and null-safety tool support.

🔎 Suggested enhancement
     @Override
+    @NotNull
     public EventStore eventStore() {
         return eventStore;
     }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f29339 and 9b3020a.

📒 Files selected for processing (1)
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java
🧰 Additional context used
🧬 Code graph analysis (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/event/BaseStoreFactory.java (1)
  • BaseStoreFactory (37-245)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build (21) / build
  • GitHub Check: build (17) / build
  • GitHub Check: build (25) / build
  • GitHub Check: qodana
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (3)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (3)

34-47: Well-documented API design.

The javadoc clearly explains the hybrid storage model and provides concrete examples of different EventStore configurations.


97-103: Good defensive shutdown implementation.

Wrapping eventStore.shutdown() in a try-catch with error logging prevents shutdown failures from cascading while maintaining observability. This is a solid resilience pattern.


110-113: Helpful toString() for debugging.

The override provides a clear, descriptive representation of the factory type, which will be useful in logs and debugging scenarios.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedissonStoreFactory.java (1)

139-142: Same Redisson client used for both pub and sub operations.

The concern about passing the same redisClient for both publisher and subscriber parameters to RedissonEventStore was already raised in a previous review. Please address the prior feedback regarding proper separation of pub/sub clients.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/memory/MemoryStoreFactory.java (1)

56-67: Unresolved documentation and grammar issues from previous review.

The issues flagged in the previous review are still present:

  1. Line 60: Missing space in @apiNote - should be version {@code not version{@code}
  2. Line 66: Grammar - "can not" should be "cannot" (one word)

These are minor text quality issues that affect documentation readability and professionalism.

🔎 Proposed fixes
-     * @apiNote Added in API version{@code 4.0.0}
+     * @apiNote Added in API version {@code 4.0.0}
      * 
      * @param eventStore non-null event store
      * @throws NullPointerException if {@code eventStore} is {@code null}
      */
     public MemoryStoreFactory(@NotNull EventStore eventStore) {
-        this.eventStore = Objects.requireNonNull(eventStore, "eventStore can not be null");
+        this.eventStore = Objects.requireNonNull(eventStore, "eventStore cannot be null");
     }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b3020a and b73a86a.

📒 Files selected for processing (3)
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/memory/MemoryStoreFactory.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedissonStoreFactory.java
🧰 Additional context used
🧬 Code graph analysis (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/event/BaseStoreFactory.java (1)
  • BaseStoreFactory (37-245)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build (25) / build
  • GitHub Check: build (17) / build
  • GitHub Check: build (21) / build
  • GitHub Check: qodana
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (16)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedissonStoreFactory.java (5)

33-105: Well-documented class-level Javadoc.

The comprehensive documentation clearly explains usage patterns, lifecycle management, thread safety guarantees, and when to use (or avoid) this factory. This is excellent for maintainability.


124-128: Good null-safety implementation.

The combination of @NotNull annotations for static analysis and Objects.requireNonNull for runtime validation is a solid defensive programming pattern.


154-157: Simple and correct delegation.

The implementation cleanly delegates to redisClient.getMap(name). Consider whether a null/empty check on name is warranted for consistency with the constructor's null-safety approach, though Redisson will handle this internally.


159-166: Robust shutdown with error handling.

Wrapping the eventStore.shutdown() in a try-catch with logging ensures that shutdown failures don't propagate and crash the application. This defensive approach is appropriate for cleanup operations.


168-171: Useful toString for debugging.

The override provides a concise descriptor that will be helpful for logging and debugging purposes.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/memory/MemoryStoreFactory.java (5)

24-24: LGTM!

The @NotNull import is properly used in the constructor parameter at line 65.


30-42: Excellent documentation!

The class-level Javadoc clearly explains the separation between session storage (memory-based) and event propagation (pluggable), along with practical usage examples. This will help users understand the various deployment patterns.


47-54: LGTM!

The default constructor is well-documented and correctly initializes with MemoryEventStore for fully local operation.


81-83: LGTM!

The explicit // no-op comment clearly indicates that shutdown is intentionally empty for memory-only storage, which is appropriate since there are no external resources to clean up.


90-93: LGTM!

The updated descriptor "memory session store" is more accurate and clear for logging and debugging purposes.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (6)

23-31: LGTM!

The imports are appropriate and used in the code. @NotNull annotations strengthen the API contract, and EventStoreMode is correctly referenced in the javadoc.


33-47: LGTM!

The class-level javadoc clearly explains the separation of concerns between session storage (Hazelcast) and event distribution (pluggable EventStore), with helpful examples of hybrid configurations.


55-69: LGTM!

The constructor properly combines compile-time annotations with runtime null checks. The explicit @throws NullPointerException documentation and @apiNote versioning improve API clarity.


91-94: LGTM!

Clean accessor implementation that properly exposes the EventStore instance.


110-113: LGTM!

The toString() implementation provides useful diagnostic information for debugging and logging.


96-103: No action needed. BaseStoreFactory does not define a shutdown() method, so there is no parent cleanup logic to call. The pattern is consistent across all implementations (MemoryStoreFactory, HazelcastStoreFactory, RedissonStoreFactory), each of which independently manages shutdown without calling super.shutdown(). The current implementation is correct.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonReliableStoreFactoryTest.java (1)

46-49: Update class name and Javadoc to match the renamed API.

The test class name and Javadoc still reference "RedissonReliableStoreFactory", but the class is now testing RedisStoreFactory. Consider renaming the test class to RedisStoreFactoryTest (or RedisReliableStoreFactoryTest) and updating the Javadoc comment for consistency with the API rename.

🔎 Suggested updates
 /**
- * Test class for RedissonReliableStoreFactory using testcontainers
+ * Test class for RedisStoreFactory using testcontainers
  */
-public class RedissonReliableStoreFactoryTest extends StoreFactoryTest {
+public class RedisStoreFactoryTest extends StoreFactoryTest {

Note: If you rename the class, ensure the filename is also updated to match.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastPubSubEventStore.java (1)

181-197: Fix incorrect exception message in topicNamePrefix() method.

Line 193 throws an exception with message "ringBufferNamePrefix cannot be empty", but the method is topicNamePrefix(). This appears to be a copy-paste error from the ring buffer variant.

Suggested fix
         public HazelcastPubSubEventStore.Builder topicNamePrefix(@NotNull String prefix) {
             if (prefix.isEmpty()) {
-                throw new IllegalArgumentException("ringBufferNamePrefix cannot be empty");
+                throw new IllegalArgumentException("topicNamePrefix cannot be empty");
             }
             this.topicNamePrefix = prefix;
             return this;
         }
♻️ Duplicate comments (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (1)

81-84: Replace empty string with null for the topicPrefix parameter.

The 5th argument passed to HazelcastPubSubEventStore is an empty string, but the constructor treats both null and "" identically—both trigger assignment of DEFAULT_TOPIC_NAME_PREFIX. Pass null instead of "" to be consistent with the parameter's nullable contract.

Suggested fix
     public HazelcastStoreFactory(@NotNull HazelcastInstance hazelcastClient) {
         this(hazelcastClient,
-             new HazelcastPubSubEventStore(hazelcastClient, hazelcastClient, null, null, ""));
+             new HazelcastPubSubEventStore(hazelcastClient, hazelcastClient, null, null, null));
     }
🧹 Nitpick comments (2)
netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedKafkaMultiChannelTest.java (1)

246-252: Consider reordering shutdown sequence.

The container is stopped before the Redisson clients are shut down. While this may work in practice (clients will fail gracefully), the cleaner approach is to shut down clients first, then the container:

🔎 Suggested reordering
         KAFKA.close();

         if (REDIS_CONTAINER!=null){
+            redisClient1.shutdown();
+            redisClient2.shutdown();
             REDIS_CONTAINER.stop();
-            redisClient1.shutdown();
-            redisClient2.shutdown();
         }
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonStoreTest.java (1)

37-37: Consider renaming test class to match the new API.

The test class is still named RedissonStoreTest while it now tests RedisStore. For consistency with the API rename, consider renaming to RedisStoreTest.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b73a86a and 00c77b6.

📒 Files selected for processing (25)
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/Configuration.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastPubSubEventStore.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast_ringbuffer/HazelcastPubSubRingBufferEventStore.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisPubSubEventStore.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStore.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_reliable/RedisPubSubReliableEventStore.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastPubSubMultiChannelUnReliableTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastPubSubSingleChannelUnreliableTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastRingBufferMultiChannelTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastRingBufferSingleChannelTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedKafkaMultiChannelTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedKafkaSingleChannelTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonPubSubMultiChannelUnReliableTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonPubSubSingleChannelUnreliableTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonReliableMultiChannelTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonReliableSingleChannelTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonStreamMultiChannelTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonStreamSingleChannelTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/store/HazelcastStoreFactoryTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonReliableStoreFactoryTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonStoreTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/HazelcastRingBufferEventStoreTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/RedissonReliableEventStoreTest.java
🧰 Additional context used
🧬 Code graph analysis (16)
netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonStreamSingleChannelTest.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (1)
  • RedisStoreFactory (107-172)
netty-socketio-core/src/main/java/com/socketio4j/socketio/Configuration.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (1)
  • RedisStoreFactory (107-172)
netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastRingBufferMultiChannelTest.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast_ringbuffer/HazelcastPubSubRingBufferEventStore.java (1)
  • HazelcastPubSubRingBufferEventStore (42-225)
netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonReliableMultiChannelTest.java (2)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (1)
  • RedisStoreFactory (107-172)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_reliable/RedisPubSubReliableEventStore.java (1)
  • RedisPubSubReliableEventStore (47-379)
netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonReliableSingleChannelTest.java (2)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (1)
  • RedisStoreFactory (107-172)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_reliable/RedisPubSubReliableEventStore.java (1)
  • RedisPubSubReliableEventStore (47-379)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonReliableStoreFactoryTest.java (3)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisPubSubEventStore.java (1)
  • RedisPubSubEventStore (43-200)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStore.java (1)
  • RedisStore (27-60)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (1)
  • RedisStoreFactory (107-172)
netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastRingBufferSingleChannelTest.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast_ringbuffer/HazelcastPubSubRingBufferEventStore.java (1)
  • HazelcastPubSubRingBufferEventStore (42-225)
netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonStreamMultiChannelTest.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (1)
  • RedisStoreFactory (107-172)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/HazelcastRingBufferEventStoreTest.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastPubSubEventStore.java (1)
  • HazelcastPubSubEventStore (41-214)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/event/BaseStoreFactory.java (1)
  • BaseStoreFactory (37-245)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/event/BaseStoreFactory.java (1)
  • BaseStoreFactory (37-245)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonStoreTest.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStore.java (1)
  • RedisStore (27-60)
netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedKafkaMultiChannelTest.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (1)
  • RedisStoreFactory (107-172)
netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonPubSubSingleChannelUnreliableTest.java (2)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisPubSubEventStore.java (1)
  • RedisPubSubEventStore (43-200)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (1)
  • RedisStoreFactory (107-172)
netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastPubSubMultiChannelUnReliableTest.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastPubSubEventStore.java (1)
  • HazelcastPubSubEventStore (41-214)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/HazelcastStoreFactoryTest.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastPubSubEventStore.java (1)
  • HazelcastPubSubEventStore (41-214)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build (17) / build
  • GitHub Check: build (25) / build
  • GitHub Check: build (21) / build
  • GitHub Check: qodana
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (47)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonReliableStoreFactoryTest.java (2)

24-26: LGTM! Import statements updated correctly.

The imports have been updated to reflect the renamed API classes (RedisPubSubEventStore, RedisStore, RedisStoreFactory), aligning with the PR objective to match documentation.


66-67: LGTM! Factory creation updated correctly.

The factory instantiation has been properly updated to use RedisStoreFactory with an explicitly constructed RedisPubSubEventStore via the builder pattern. This aligns with the new API structure.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisPubSubEventStore.java (2)

43-43: LGTM! Class rename is consistent.

The rename from RedissonEventStore to RedisPubSubEventStore is applied consistently across the class declaration, logger, and constructor. The @NotNull/@Nullable annotations combined with Objects.requireNonNull validation provide proper null safety.

Also applies to: 54-54, 66-69


190-196: Builder correctly updated.

The build() method return type and instantiation are properly aligned with the renamed class.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStore.java (1)

27-33: LGTM! Clean rename from RedissonStore to RedisStore.

The class name change aligns with the API naming convention while correctly retaining RedissonClient as the underlying implementation detail.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_reliable/RedisPubSubReliableEventStore.java (2)

47-47: LGTM! Class rename applied consistently.

The rename from RedissonReliableEventStore to RedisPubSubReliableEventStore is properly reflected in the class declaration, logger initialization, and constructor. The reliable event store maintains its comprehensive stream trimming and shutdown handling logic.

Also applies to: 63-63, 71-76


366-376: Builder correctly updated for the renamed class.

The build() method properly returns the new RedisPubSubReliableEventStore type.

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedKafkaMultiChannelTest.java (1)

52-52: LGTM! Correctly migrated to RedisStoreFactory.

The test properly uses the new RedisStoreFactory with the two-argument constructor accepting a RedissonClient and a KafkaEventStore, maintaining the hybrid Redis session storage + Kafka event propagation pattern.

Also applies to: 97-101, 144-148

netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonStoreTest.java (1)

21-21: LGTM! Test correctly updated to use RedisStore.

The import and instantiation are properly aligned with the renamed class.

Also applies to: 54-54

netty-socketio-core/src/test/java/com/socketio4j/socketio/store/HazelcastStoreFactoryTest.java (2)

35-35: LGTM! Factory correctly updated to use HazelcastPubSubEventStore.

The import, builder usage, and factory construction are properly aligned with the renamed Hazelcast event store implementation.

Also applies to: 69-71


114-114: Assertion correctly updated.

The type check properly validates against HazelcastPubSubEventStore.class.

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedKafkaSingleChannelTest.java (1)

52-52: Test updated correctly to use RedisStoreFactory.

The import and constructor usages have been updated consistently for both test nodes. The constructor arguments match the new API signature.

Also applies to: 97-99, 144-146

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonStreamMultiChannelTest.java (1)

37-37: Test updated correctly to use RedisStoreFactory with Redis Streams.

The import and constructor usages have been updated consistently for both test nodes using RedisStreamEventStore in MULTI_CHANNEL mode.

Also applies to: 71-74, 117-120

netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/HazelcastRingBufferEventStoreTest.java (1)

26-26: Test updated correctly to use HazelcastPubSubEventStore.

The import and builder usage have been updated to use separate publish and subscribe Hazelcast instances, which aligns with the new API design.

Also applies to: 54-54

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastRingBufferSingleChannelTest.java (1)

38-38: Test updated correctly to use HazelcastPubSubRingBufferEventStore.

The import on line 38 and builder usages on lines 78-79 and 123-124 have been updated consistently for both test nodes in SINGLE_CHANNEL mode. No remaining references to the old HazelcastRingBufferEventStore class name exist in the codebase.

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonPubSubSingleChannelUnreliableTest.java (2)

37-38: API imports updated to match documentation.

The import changes from RedissonStoreFactory/RedissonEventStore to RedisStoreFactory/RedisPubSubEventStore align with the PR objective to rename APIs for version 4.0.0.


71-73: Store factory configuration correctly updated.

Both node configurations properly use the new RedisStoreFactory constructor with RedisPubSubEventStore.Builder to configure SINGLE_CHANNEL mode for distributed testing.

Also applies to: 116-118

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonPubSubMultiChannelUnReliableTest.java (1)

37-38: API updates consistent with multi-channel test requirements.

The changes mirror the single-channel test but correctly configure EventStoreMode.MULTI_CHANNEL for both nodes, which is appropriate for this test class.

Also applies to: 71-73, 116-118

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonStreamSingleChannelTest.java (1)

37-37: Factory renamed while preserving Redis Stream event store.

The RedisStoreFactory rename is correctly applied while maintaining the use of RedisStreamEventStore.Builder, demonstrating the factory's ability to work with different event store implementations.

Also applies to: 71-71, 116-116

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastPubSubSingleChannelUnreliableTest.java (1)

37-37: Hazelcast API updated consistently with Redis variants.

The import and factory instantiation changes from HazelcastEventStore to HazelcastPubSubEventStore follow the same naming pattern as the Redis variants, maintaining consistency across the codebase.

Also applies to: 78-78, 123-123

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast_ringbuffer/HazelcastPubSubRingBufferEventStore.java (3)

42-42: Class renamed to include PubSub qualifier.

The rename from HazelcastRingBufferEventStore to HazelcastPubSubRingBufferEventStore is consistent with the broader API renaming effort and appropriately identifies the pub/sub nature of this event store variant.


53-53: Logger reference correctly updated.

The logger initialization properly references the renamed class, ensuring log statements will display the correct class name.


58-58: Constructor name updated to match class.

The constructor name correctly matches the renamed class, maintaining proper Java syntax.

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonReliableSingleChannelTest.java (3)

37-38: LGTM! Import updates align with the API renaming.

The imports correctly reference the renamed classes (RedisStoreFactory and RedisPubSubReliableEventStore) matching the PR objective of aligning API names with documentation.


72-74: LGTM! Correctly configures Node1 with SINGLE_CHANNEL mode.

The RedisPubSubReliableEventStore.Builder usage is consistent with the API shown in the relevant code snippets—single RedissonClient constructor delegates to the pub/sub variant.


117-119: LGTM! Node2 configuration mirrors Node1 correctly.

Both nodes use consistent RedisStoreFactory + RedisPubSubReliableEventStore wiring with SINGLE_CHANNEL mode.

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastPubSubMultiChannelUnReliableTest.java (3)

37-38: LGTM! Import updated to the renamed HazelcastPubSubEventStore class.

The import change aligns with the API renaming from HazelcastEventStore to HazelcastPubSubEventStore.


77-79: LGTM! Node1 correctly configured with HazelcastPubSubEventStore.

The builder usage with MULTI_CHANNEL mode matches the test purpose and is consistent with the new API.


124-125: LGTM! Node2 mirrors Node1 configuration.

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedHazelcastRingBufferMultiChannelTest.java (3)

38-38: LGTM! Import updated to renamed HazelcastPubSubRingBufferEventStore.

Aligns with the API renaming objective.


77-79: LGTM! Node1 correctly uses HazelcastPubSubRingBufferEventStore.Builder.

The MULTI_CHANNEL mode is explicitly set, matching the test class name.


122-124: LGTM! Node2 configuration is consistent with Node1.

netty-socketio-core/src/test/java/com/socketio4j/socketio/integration/DistributedRedissonReliableMultiChannelTest.java (3)

37-38: LGTM! Imports updated to renamed Redis classes.

Consistent with the API renaming pattern across the codebase.


71-74: LGTM! Node1 correctly configured with MULTI_CHANNEL mode.

The RedisPubSubReliableEventStore.Builder usage with MULTI_CHANNEL matches the test class name.


117-120: LGTM! Node2 configuration mirrors Node1.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (6)

23-23: LGTM! Added @NotNull annotation import for null-safety.

Good practice to use JetBrains annotations for compile-time null checking.


33-47: LGTM! Well-documented class javadoc.

The documentation clearly explains the factory's purpose, hybrid configuration options, and the default behavior when no EventStore is supplied.


65-69: LGTM! Primary constructor with proper null-safety.

The @NotNull annotations combined with Objects.requireNonNull provide both compile-time and runtime protection.


92-94: LGTM! Exposes the configured EventStore instance.

Required by the abstract BaseStoreFactory.eventStore() method.


97-103: LGTM! Defensive shutdown with exception handling.

Wrapping eventStore.shutdown() in try-catch prevents shutdown failures from propagating and logs the error for diagnosability.


110-113: LGTM! Useful toString() for debugging.

Provides a descriptive representation of the factory instance.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (2)

144-157: LGTM! Core factory methods are well-implemented.

createStore(), eventStore(), and createMap() follow the same pattern as HazelcastStoreFactory.


159-171: LGTM! Shutdown and toString implementations are consistent.

The try-catch in shutdown() and descriptive toString() match the pattern established in HazelcastStoreFactory.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastPubSubEventStore.java (4)

41-41: LGTM! Class renamed to HazelcastPubSubEventStore.

The rename aligns with the PR objective of matching API names to documentation.


54-54: LGTM! Logger updated to reference the renamed class.


56-83: LGTM! Constructor implementation is correct.

Proper null-safety with Objects.requireNonNull and sensible defaults for optional parameters.


203-211: LGTM! Builder correctly returns HazelcastPubSubEventStore.

The build() method properly instantiates the renamed class.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/HazelcastRingBufferEventStoreTest.java (1)

28-30: Test class name doesn't match the implementation being tested.

The class name HazelcastRingBufferEventStoreTest suggests it tests a RingBuffer-based event store, but it actually tests HazelcastPubSubEventStore, which uses Topics (ITopic) for pub/sub messaging. The comment on line 28 mentions "HazelcastPubSubStore," which aligns with the implementation but not the class name.

Consider renaming this test class to HazelcastPubSubEventStoreTest to match the implementation being tested.

🔎 Suggested fix
 /**
- * Test class for HazelcastPubSubStore using testcontainers
+ * Test class for HazelcastPubSubEventStore using testcontainers
  */
-public class HazelcastRingBufferEventStoreTest extends AbstractEventStoreTest {
+public class HazelcastPubSubEventStoreTest extends AbstractEventStoreTest {
🧹 Nitpick comments (1)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonReliableStoreFactoryTest.java (1)

45-47: Consider renaming for consistency with the refactored API.

The test class name, comments, and variable names still reference "Redisson" specifically, while the actual implementation under test is now RedisStoreFactory. For clarity and consistency with the refactored API, consider:

  • Renaming the class from RedissonReliableStoreFactoryTest to RedisStoreFactoryTest
  • Updating the class-level comment (line 45) to reference RedisStoreFactory
  • Updating method comments to be more generic (e.g., "Test that the factory creates Redis-backed stores" on line 91)
  • Using more generic variable names (e.g., redisKey instead of redissonKey)

This would better reflect that the public API is now Redis-focused rather than Redisson-specific, even though Redisson remains the underlying implementation.

Also applies to: 91-91, 98-100, 113-113

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00c77b6 and f921161.

📒 Files selected for processing (5)
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonReliableStoreFactoryTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/HazelcastRingBufferEventStoreTest.java
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/RedisEventStoreTest.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java
🧰 Additional context used
🧬 Code graph analysis (2)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/HazelcastRingBufferEventStoreTest.java (1)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastPubSubEventStore.java (1)
  • HazelcastPubSubEventStore (41-214)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonReliableStoreFactoryTest.java (3)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisPubSubEventStore.java (1)
  • RedisPubSubEventStore (43-200)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStore.java (1)
  • RedisStore (27-60)
netty-socketio-core/src/main/java/com/socketio4j/socketio/store/redis_pubsub/RedisStoreFactory.java (1)
  • RedisStoreFactory (107-172)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build (17) / build
  • GitHub Check: build (21) / build
  • GitHub Check: build (25) / build
  • GitHub Check: qodana
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (14)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/RedissonReliableStoreFactoryTest.java (4)

22-24: LGTM!

The import statements correctly reflect the renamed classes from the refactoring.


64-65: LGTM!

The factory instantiation correctly uses the new RedisStoreFactory constructor with the RedisPubSubEventStore.Builder, matching the refactored API.


96-96: LGTM!

The assertion message now correctly matches the type being checked. The previous review comment has been addressed.


108-108: LGTM!

The assertion message now correctly matches the type being checked. The previous review comment has been addressed.

netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/RedisEventStoreTest.java (1)

30-30: Verify test intent and consider more specific class name.

The class has been renamed from RedissonReliableEventStoreTest to RedisEventStoreTest, which removes the "Reliable" claim but is still generic. Since the test instantiates RedisPubSubEventStore (line 49), consider renaming to RedisPubSubEventStoreTest for clarity.

Additionally, per the previous review, RedisPubSubEventStore is documented as the unreliable pub/sub implementation. Please verify:

  • Is testing the unreliable store intentional?
  • If a reliable store test is needed, should this use RedisPubSubReliableEventStore instead?

This partially addresses the past review concern but could benefit from clearer naming.

Also applies to: 49-49

netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/HazelcastRingBufferEventStoreTest.java (3)

25-25: LGTM! Import updated correctly.

The import has been correctly updated to reflect the renamed class HazelcastPubSubEventStore.


41-54: LGTM! Builder usage updated correctly.

The builder invocation has been correctly updated to use HazelcastPubSubEventStore.Builder, and the usage pattern aligns with the new API shown in the implementation.


57-61: LGTM! Resource cleanup is appropriate.

The teardown method properly cleans up both Hazelcast client instances and the container with appropriate null checks.

netty-socketio-core/src/main/java/com/socketio4j/socketio/store/hazelcast/HazelcastStoreFactory.java (6)

34-47: Excellent documentation of the factory's pluggable design.

The class-level Javadoc clearly explains the separation between session storage (Hazelcast) and event propagation (pluggable EventStore), and provides helpful examples of hybrid configurations.


55-69: Strong null-safety enforcement on the primary constructor.

The @NotNull annotations combined with explicit null checks provide clear contracts and fail-fast behavior.


92-94: Clean public accessor for the EventStore.

The method provides appropriate public access to the configured event store implementation.


97-103: Robust error handling in shutdown.

The try-catch block with error logging ensures that shutdown failures don't propagate, improving the factory's lifecycle management reliability.


110-114: Helpful toString() implementation for debugging.

The descriptive output will aid in logging and debugging scenarios.


71-84: All verification points are confirmed correct. The HazelcastPubSubEventStore constructor signature matches the call in HazelcastStoreFactory (line 83), and passing null for both eventStoreMode and topicPrefix correctly defaults to EventStoreMode.MULTI_CHANNEL and "SOCKETIO4J:" respectively, as documented in the Javadoc.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f921161 and fba89ba.

📒 Files selected for processing (1)
  • netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/RedisPubSubEventStoreTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build (25) / build
  • GitHub Check: build (21) / build
  • GitHub Check: build (17) / build
  • GitHub Check: qodana
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (1)
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/RedisPubSubEventStoreTest.java (1)

25-25: LGTM! Test class rename addresses previous feedback.

The test class has been correctly renamed to RedisPubSubEventStoreTest, and the import and instantiation are now consistent. This properly addresses the previous review comment about the name/implementation mismatch.

Also applies to: 30-30, 49-49

Comment on lines 27 to 29
/**
* Test class for RedissonReliableEventStore using testcontainers
* Test class for RedisPubSubEventStoreTest using testcontainers
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix Javadoc typo: reference the implementation, not the test class.

The Javadoc should reference RedisPubSubEventStore (the implementation under test), not RedisPubSubEventStoreTest (the test class itself).

🔎 Proposed fix
 /**
- * Test class for RedisPubSubEventStoreTest using testcontainers
+ * Test class for RedisPubSubEventStore using testcontainers
  */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* Test class for RedissonReliableEventStore using testcontainers
* Test class for RedisPubSubEventStoreTest using testcontainers
*/
/**
* Test class for RedisPubSubEventStore using testcontainers
*/
🤖 Prompt for AI Agents
In
netty-socketio-core/src/test/java/com/socketio4j/socketio/store/event/RedisPubSubEventStoreTest.java
around lines 27 to 29, the Javadoc incorrectly references the test class name;
update the Javadoc comment to reference the implementation under test,
RedisPubSubEventStore, instead of RedisPubSubEventStoreTest. Edit the Javadoc
sentence to mention RedisPubSubEventStore (and keep the rest of the comment
intact), then save and run tests to ensure no further documentation linter
issues.

@NeatGuyCoding NeatGuyCoding merged commit 427939f into main Jan 2, 2026
10 checks passed
@NeatGuyCoding NeatGuyCoding deleted the storefactory-api-final-4.0.0 branch January 2, 2026 03:25
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