Releases: BitByLogics/Bits-RPS
Releases · BitByLogics/Bits-RPS
v1.2.0 - Refactor & Test Coverage
Changelog
Refactor
- Replace
CopyOnWriteArrayListwithConcurrentHashMapinRedisManagerfor client storage registerClientnow returns@NotNulland uses case-insensitive key matching to prevent duplicate IDs- Remove
CompletableFutureusage inRedisClientand simplify topic handling - Move
TimedRequestSerializerfromnet.bitbylogic.rps.gsontonet.bitbylogic.rps - Reduce
TimedRequestSerializeraccess level to package-private - Change null channel fallback to empty string in
TimedRequestSerializer - Introduce static shared
GSONinstance inListenerComponentwithenableComplexMapKeySerialization() - Remove pretty printing from
RedisManagerGSON instance - Change
ListenerComponent(targetServerId, channel)constructor fromprivatetopublic - Change
setAllowSelfActivation()fromprivatetoprotectedinRedisMessageListener - Add
@Contractannotations to fluent methods inListenerComponent - Add
@CheckReturnValuetogetData,getDataOrElse, andgetRequestByIDinListenerComponent - Add
@CheckReturnValuetoRedisManager#registerClient
Style
- Fix Javadoc paragraph formatting in
RedisClient
Tests
- Add
RedisManagerTestusing JUnit 5 and TestContainers - Add test coverage for duplicate client registration, message send/receive, self-activation, multiple listeners, server ID filtering, timed request timeout/success, and malformed JSON handling
- Add
maven-surefire-plugin,junit-jupiter, andtestcontainers-redisdependencies
Refactor/Cleanup!
Breaking Changes
RedisManager.getSourceID()renamed togetServerId()RedisClientfieldIDrenamed toclientId; getter updated accordinglyListenerComponentfieldtargetrenamed totargetServerIdRedisManagerconstructor signature changed, theConfig-based overload now takes(Config, String)instead of(String, int, String, String, Config)
New Features
- Added a second
RedisManagerconstructor accepting a pre-builtConfigobject for more flexible Redis configuration - Javadoc auto-build and publish to GitHub Pages via new
.github/workflows/javadocs.ymlworkflow maven-javadoc-pluginadded topom.xmlwith Java 21 and lenient doclint settings
Improvements
RedisClientinternal collections migrated to thread-safe types:CopyOnWriteArrayListforlistenersandtimedRequests,ConcurrentHashMapforrequestTimers- Channel registration logic extracted into dedicated
registerChannel()andregisterRequestTopic()private methods inRedisClient, reducing constructor complexity - Duplicate listener registration now logs a warning and returns early instead of silently adding a second instance
JsonSyntaxExceptionon the request topic is now caught and logged atWARNINGlevel rather than crashingRedisManagerconnection errors now useLogger.log(Level.SEVERE, ..., exception)instead ofprintStackTrace()Gsoninstance inRedisManagermadestatic final(shared across all instances)- Debug format strings extracted to
static finalconstants inRedisClient @NotNull/@Nullableannotations added throughout for improved null-safety documentation- Comprehensive Javadoc added to all public methods and constructors across
RedisClient,RedisManager,ListenerComponent,RedisMessageListener,RedisTimedRequest, andRedisTimedResponse
Initial Release
Initial release!