Skip to content

feat(hazelcast): add Hazelcast cluster example - #37

Open
SteKoe wants to merge 5 commits into
mainfrom
feat/hazelcast-example
Open

SteKoe wants to merge 5 commits into
mainfrom
feat/hazelcast-example

Conversation

@SteKoe

@SteKoe SteKoe commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Adds a hazelcast/ example to reproduce Hazelcast clustering issues and to try out open PRs.

Setup

  • 3 SBA nodes forming a Hazelcast cluster (TCP/IP join) behind an nginx round-robin load balancer (:8080)
  • 2 health simulators that self-register through the load balancer and report which SBA node polls them (/pollers, via X-SBA-Node header)
  • Mailpit (:8026) to see which node sent a notification
  • /actuator/playground per node: cluster members, event store, notification trigger, notifiers, map sizes
  • Scenario switching without rebuild: ./run.sh <scenario>; combine several with docker compose --env-file a.env --env-file b.env up -d --force-recreate
  • Helpers: ./inspect.sh, ./redeploy.sh [--kill]
  • SBA_VERSION=<version> ./buildAndRunAll.sh builds against a locally installed SBA (e.g. a PR branch, installed with -Drevision=... to keep other snapshots untouched)

Scenarios and results

Topic Scenario Result
codecentric/spring-boot-admin#5726 default vs notifier-bean Reproduced on 4.1.4: property notifier → plain NotificationTrigger, 3 mails; @Bean notifier → HazelcastNotificationTrigger, 1 mail. Tested PR head 4c5b3eed6: 1 mail in all scenarios (properties, @Bean, user FilteringNotifier, AOT, node restart), no startup cycle
codecentric/spring-boot-admin#2795 default, event-store-ttl + ./redeploy.sh Graceful stop deregisters; --kill leaves the old instance OFFLINE on all nodes
codecentric/spring-boot-admin#4773 in-memory-event-store Workaround works; nodes briefly show different instances (registration reaches one node only)
codecentric/spring-boot-admin#5743 sharding Prototype: each instance polled by one node (partition owner), failover on node stop works
codecentric/spring-boot-admin#5739 selective-caches, sent-notifications-disabled, hazelcast-disabled, aot Tested against PR head cf35dd37b, see below
codecentric/spring-boot-admin#5266 endpoint-cache Needs PR build, not run yet

codecentric/spring-boot-admin#5739 (PR build cf35dd37b)

Scenario Event store Notification trigger Mails per status change
default Hazelcast NotificationTrigger 3 (#5726 bug, not fixed by this PR)
selective-caches InMemory NotificationTrigger –
hazelcast-disabled InMemory NotificationTrigger –
notifier-bean – – context fails to start
notifier-filtering-bean Hazelcast HazelcastNotificationTrigger 1
sent-notifications-disabled Hazelcast NotificationTrigger 3
selective-caches + notifier-filtering-bean InMemory HazelcastNotificationTrigger 1
  • The *-enabled flags work at runtime. (An earlier AOT claim here was wrong: SPRING_AOT_ENABLED does not enable AOT. Use -Dspring.aot.enabled=true and look for Starting AOT-processed.)
  • A single user MailNotifier @Bean fails with filteringNotifier -> compositeNotifier -> filteringNotifier (comes from #5737, fixed by #5726), also with notification-filters-enabled=false. notifier-filtering-bean avoids it with a user defined @Primary FilteringNotifier.
  • With property notifiers the notification flags have no effect (#5726).

codecentric/spring-boot-admin#5739 after the force push (da1b8914c)

Conflict free, tests pass, but @ConditionalOnProperty on sentNotificationsMap/notificationFiltersMap is evaluated at build time: with real AOT, sent-notifications-enabled=false is ignored (HazelcastNotificationTrigger still used). Without AOT it works.

codecentric/spring-boot-admin#5739 rebased on master with #5726 (local rebase 921fedef1)

  • selective-caches (local event store, Hazelcast sent-notifications) now gives HazelcastNotificationTrigger and 1 mail, also with property notifiers and with real AOT. This is the setup requested in #4773.
  • sent-notifications-disabled: plain NotificationTrigger, every node notifies. notification-filters-enabled=false: notificationFiltersMap is a local map.
  • The old auto-created FilteringNotifier no longer exists, so the PR's test for the filters flag had to change.

codecentric/spring-boot-admin#5726 (PR build 4c5b3eed6)

  • default, notifier-bean, notifier-filtering-bean: HazelcastNotificationTrigger on all nodes, 1 mail per status change. Also 1 mail after restarting a node.
  • The PR's tests pass (17 tests in the 4 Hazelcast related test classes).
  • #5739 conflicts with it in AdminServerHazelcastAutoConfiguration, so merge #5726 first and rebase #5739.

Notes

  • AOT is disabled in the SBA image by default, since the playground switches use @ConditionalOnProperty (evaluated at build time under AOT). The aot scenario re-enables it.
  • Not covered yet: per-node last status in AbstractStatusChangeNotifier (#5716), #5266 results.

Three SBA nodes behind nginx with self-registering clients, Mailpit and
scenario switches to reproduce codecentric/spring-boot-admin#2795, #4773,
#5743 and to try PRs #5266, #5726, #5739.
Add filtering-bean notifier variant (avoids filteringNotifier/compositeNotifier
cycle), sent-notifications-disabled and hazelcast-disabled scenarios, and
document results against the PR build.
@SteKoe

SteKoe commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Tested codecentric/spring-boot-admin#5739 (head cf35dd37b, installed as 4.1.5-pr5739-SNAPSHOT). Added scenarios notifier-filtering-bean, sent-notifications-disabled, hazelcast-disabled; results are in the README (section "Results with the PR build").

  • All *-enabled flags work at runtime, also with AOT.
  • A single user MailNotifier @Bean (notifier-bean) fails with the filteringNotifier -> compositeNotifier cycle from #5737 (fixed by #5726), also with notification-filters-enabled=false.
  • With property notifiers the notification flags have no effect (#5726).

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.

1 participant