Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a96895c
Add sample for blog
TomaszGaweda Feb 9, 2026
3e09174
Add README.md
TomaszGaweda Feb 9, 2026
fa9b0af
Update spring/resilient-sessions/src/main/resources/application.prope…
TomaszGaweda Feb 9, 2026
a1af934
Update spring/resilient-sessions/pom.xml
TomaszGaweda Feb 9, 2026
5879edd
Restore parent
TomaszGaweda Feb 9, 2026
793cf92
Use List.of
TomaszGaweda Feb 9, 2026
3c6ed2f
Update spring/resilient-sessions/src/main/java/com/hazelcast/samples/…
TomaszGaweda Feb 9, 2026
d086e09
Other styling
TomaszGaweda Feb 9, 2026
32391aa
Remove author tag
TomaszGaweda Feb 9, 2026
c2308d9
Add JavaDoc to constant
TomaszGaweda Feb 9, 2026
8ab6f9a
Update gitignore
TomaszGaweda Feb 9, 2026
9816c4e
Update spring/resilient-sessions/src/main/java/com/hazelcast/samples/…
TomaszGaweda Feb 10, 2026
7027410
Update .gitignore
TomaszGaweda Feb 11, 2026
6f9ff3c
Update pom with TODO
TomaszGaweda Feb 11, 2026
2ce5b8d
Merge remote-tracking branch 'origin/add-session-resilience-and-analy…
TomaszGaweda Feb 11, 2026
3eeb4b4
Added JavaDoc
TomaszGaweda Feb 11, 2026
3735bd4
Added JavaDoc
TomaszGaweda Feb 11, 2026
2beca3a
Checkstyle
TomaszGaweda Feb 11, 2026
08f647c
Remove unnecessary file modified in each build
TomaszGaweda Feb 11, 2026
1225e4f
Remove common properties
TomaszGaweda Feb 12, 2026
8e6a733
Update spring/resilient-sessions/pom.xml
TomaszGaweda Feb 12, 2026
fcb425f
Use new version
TomaszGaweda Feb 12, 2026
42e4e62
Update Artifact ID
TomaszGaweda Feb 12, 2026
a47c70e
More in readme.md
TomaszGaweda Feb 13, 2026
86b3349
Restore 5.6.0 here
TomaszGaweda Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ osgi/felix-cache/
*.code-workspace
dependency-reduced-pom.xml
/enterprise/tls-rbac-demo/keymaterial/

**/licensekey.env

This file was deleted.

6 changes: 1 addition & 5 deletions spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,10 @@
<module>spring-boot-caching-jcache</module>
<module>spring-boot-session-replication-spring-session-hazelcast</module>
<module>spring-session-servlet</module>
<module>resilient-sessions</module>
</modules>

<dependencies>
<dependency>
<groupId>com.hazelcast.samples</groupId>
<artifactId>helper</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions spring/resilient-sessions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Resilient web sessions example

This example is associated with blog post.
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.

What blog post? Can you link to it?

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.

Not released yet :(


You can go to `docker` folder, create `licensekey.env` with `HZ_LICENSEKEY=<your key here>` and then start cluster using `docker-compose up`.

After that, you can run `Main` class.
32 changes: 32 additions & 0 deletions spring/resilient-sessions/docker/conf-lon/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
hazelcast:
cluster-name: london-cluster
network:
port:
port-count: 20
auto-increment: true
port:
5701
join:
multicast:
enabled: false
tcp-ip:
enabled: true
member-list:
- london-cluster-1
wan-replication:
replicate-to-nyc:
batch-publisher:
nycPublisher:
cluster-name: nyc-cluster
target-endpoints: "nyc-cluster-1:5701"
map:
shopSessions:
wan-replication-ref:
replicate-to-nyc:
merge-policy-class-name: PutIfAbsentMergePolicy
backup-count: 1
# because we are modifying IMap's config not via sessionMapConfigCustomizer, we need to add the index manually
indexes:
- type: HASH
attributes:
- "principalName"
32 changes: 32 additions & 0 deletions spring/resilient-sessions/docker/conf-newyork/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
hazelcast:
cluster-name: nyc-cluster
network:
port:
port-count: 20
auto-increment: true
port:
5701
join:
multicast:
enabled: false
tcp-ip:
enabled: true
member-list:
- nyc-cluster-1
wan-replication:
replicate-to-lon:
batch-publisher:
lonPublisher:
cluster-name: london-cluster
target-endpoints: "london-cluster-1:5701"
map:
shopSessions:
wan-replication-ref:
replicate-to-lon:
merge-policy-class-name: PutIfAbsentMergePolicy
backup-count: 1
# because we are modifying IMap's config not via sessionMapConfigCustomizer, we need to add the index manually
indexes:
- type: HASH
attributes:
- "principalName"
33 changes: 33 additions & 0 deletions spring/resilient-sessions/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: resilient-sessions

services:
london-cluster:
image: hazelcast/hazelcast-enterprise:latest
hostname: london-cluster-1
ports:
- "5701:5701"
volumes:
- ./conf-lon:/opt/hazelcast/config
env_file:
- licensekey.env
environment:
- HAZELCAST_CONFIG=/opt/hazelcast/config/config.yml

nyc-cluster:
image: hazelcast/hazelcast-enterprise:latest
hostname: nyc-cluster-1
ports:
- "5702:5701"
volumes:
- ./conf-newyork:/opt/hazelcast/config
env_file:
- licensekey.env
environment:
- HAZELCAST_CONFIG=/opt/hazelcast/config/config.yml

management-center:
image: hazelcast/management-center:latest
ports:
- "8180:8080"
env_file:
- licensekey.env
97 changes: 97 additions & 0 deletions spring/resilient-sessions/pom.xml
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.

I haven't checked - but are any of these dependencies overlapping? E.G. does spring boot bring in spring-core?

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.

Spring Security does not, Spring Boot does bring Spring Web, but I wanted to pin to newer version.

Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>resilient-sessions-blog</artifactId>
<parent>
<groupId>com.hazelcast.samples</groupId>
<artifactId>spring</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<properties>
<spring.version>7.0.2</spring.version>
<spring-boot.version>4.0.0</spring-boot.version>

<!-- needed for checkstyle/findbugs -->
<main.basedir>${project.parent.parent.basedir}</main.basedir>
</properties>

<repositories>
<repository>
<id>Hazelcast Private Snapshot Repository</id>
<url>https://repository.hazelcast.com/snapshot/</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>Hazelcast Private Release Repository</id>
<url>https://repository.hazelcast.com/release/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
Comment thread
JackPGreen marked this conversation as resolved.

<dependencies>
<!-- TODO update post-release -->
<dependency>
<groupId>com.hazelcast.spring</groupId>
<artifactId>hazelcast-spring-session</artifactId>
<version>4.0.0-RC1</version>
<exclusions>
<exclusion>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-enterprise</artifactId>
<version>${hazelcast.version}</version>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-spring</artifactId>
<version>${hazelcast.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-hazelcast</artifactId>
<version>${spring-boot.version}</version>
</dependency>

<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>1.0.0</version>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>

</project>
Loading
Loading