Skip to content

Update to hazelcast 5.4.0, Spring Boot 3 and Java 17 #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8' ]
java: [ '17' ]
architecture: [ 'x64' ]
name: Build with JDK ${{ matrix.java }} on ${{ matrix.architecture }}
steps:
Expand All @@ -31,4 +31,3 @@ jobs:

- name: Run Tests
run: mvn verify -Ptests

3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM gcr.io/distroless/java17-debian11:nonroot
COPY target/*.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/hazelcast-embedded-springboot.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ include::ROOT:example$hazelcast-embedded-springboot/src/main/java/guides/hazelca
Run the application using Maven in a terminal:

----
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dserver.port=8080"
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dserver.port=8080 --spring.profiles.active=local"
----

Then, rerun the application in another terminal.

NOTE: Notice the different value for the `server.port` argument.

----
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dserver.port=8081"
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dserver.port=8081 --spring.profiles.active=local"
----

After both application instances are initialized, you should see that the Hazelcast cluster is formed:
Expand Down
16 changes: 5 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.1</version>
<relativePath/>
<version>3.2.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<java.version>1.8</java.version>
<hazelcast.version>5.3.2</hazelcast.version>
<java.version>17</java.version>
<hazelcast.version>5.4.0</hazelcast.version>
</properties>

<build>
Expand All @@ -36,7 +36,7 @@
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<version>3.2.5</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -74,11 +74,5 @@
<artifactId>spring-boot-starter-webflux</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.3</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
25 changes: 25 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
logging:
level:
com.hazelcast: TRACE
org.springframework: INFO
root: ERROR

spring:
hazelcast:
config: classpath:hazelcast.yaml

--- # profile: local
spring:
config:
activate:
on-profile: local
hazelcast:
config: classpath:hazelcast-local.yaml

--- # profile: tests
spring:
config:
activate:
on-profile: tests
hazelcast:
config: classpath:hazelcast-local.yaml
6 changes: 6 additions & 0 deletions src/main/resources/hazelcast-local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hazelcast:
cluster-name: hazelcast-cluster
network:
join:
multicast:
enabled: true
12 changes: 11 additions & 1 deletion src/main/resources/hazelcast.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
hazelcast:
cluster-name: hazelcast-cluster
network:
interfaces:
enabled: true
interfaces:
- 10.0.*.*
join:
multicast:
enabled: false
aws:
enabled: true
hz-port: 5701