Skip to content

Releases: BitByLogics/Bits-RPS

v1.2.0 - Refactor & Test Coverage

26 Mar 23:54

Choose a tag to compare

Changelog

Refactor

  • Replace CopyOnWriteArrayList with ConcurrentHashMap in RedisManager for client storage
  • registerClient now returns @NotNull and uses case-insensitive key matching to prevent duplicate IDs
  • Remove CompletableFuture usage in RedisClient and simplify topic handling
  • Move TimedRequestSerializer from net.bitbylogic.rps.gson to net.bitbylogic.rps
  • Reduce TimedRequestSerializer access level to package-private
  • Change null channel fallback to empty string in TimedRequestSerializer
  • Introduce static shared GSON instance in ListenerComponent with enableComplexMapKeySerialization()
  • Remove pretty printing from RedisManager GSON instance
  • Change ListenerComponent(targetServerId, channel) constructor from private to public
  • Change setAllowSelfActivation() from private to protected in RedisMessageListener
  • Add @Contract annotations to fluent methods in ListenerComponent
  • Add @CheckReturnValue to getData, getDataOrElse, and getRequestByID in ListenerComponent
  • Add @CheckReturnValue to RedisManager#registerClient

Style

  • Fix Javadoc paragraph formatting in RedisClient

Tests

  • Add RedisManagerTest using 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, and testcontainers-redis dependencies

Refactor/Cleanup!

26 Mar 05:48

Choose a tag to compare

Breaking Changes

  • RedisManager.getSourceID() renamed to getServerId()
  • RedisClient field ID renamed to clientId; getter updated accordingly
  • ListenerComponent field target renamed to targetServerId
  • RedisManager constructor signature changed, the Config-based overload now takes (Config, String) instead of (String, int, String, String, Config)

New Features

  • Added a second RedisManager constructor accepting a pre-built Config object for more flexible Redis configuration
  • Javadoc auto-build and publish to GitHub Pages via new .github/workflows/javadocs.yml workflow
  • maven-javadoc-plugin added to pom.xml with Java 21 and lenient doclint settings

Improvements

  • RedisClient internal collections migrated to thread-safe types: CopyOnWriteArrayList for listeners and timedRequests, ConcurrentHashMap for requestTimers
  • Channel registration logic extracted into dedicated registerChannel() and registerRequestTopic() private methods in RedisClient, reducing constructor complexity
  • Duplicate listener registration now logs a warning and returns early instead of silently adding a second instance
  • JsonSyntaxException on the request topic is now caught and logged at WARNING level rather than crashing
  • RedisManager connection errors now use Logger.log(Level.SEVERE, ..., exception) instead of printStackTrace()
  • Gson instance in RedisManager made static final (shared across all instances)
  • Debug format strings extracted to static final constants in RedisClient
  • @NotNull / @Nullable annotations added throughout for improved null-safety documentation
  • Comprehensive Javadoc added to all public methods and constructors across RedisClient, RedisManager, ListenerComponent, RedisMessageListener, RedisTimedRequest, and RedisTimedResponse

Initial Release

13 Jan 22:04

Choose a tag to compare

Initial release!