diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 562a109..8e6b992 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -31,4 +31,3 @@ jobs: - name: Run Tests run: mvn verify -Ptests - diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..aa8b5a5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM gcr.io/distroless/java17-debian11:nonroot +COPY target/*.jar app.jar +ENTRYPOINT ["java","-jar","app.jar"] diff --git a/docs/modules/ROOT/pages/hazelcast-embedded-springboot.adoc b/docs/modules/ROOT/pages/hazelcast-embedded-springboot.adoc index 31d8771..b70d053 100644 --- a/docs/modules/ROOT/pages/hazelcast-embedded-springboot.adoc +++ b/docs/modules/ROOT/pages/hazelcast-embedded-springboot.adoc @@ -42,7 +42,7 @@ 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. @@ -50,7 +50,7 @@ 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: diff --git a/pom.xml b/pom.xml index bd64f34..195c553 100644 --- a/pom.xml +++ b/pom.xml @@ -11,13 +11,13 @@ org.springframework.boot spring-boot-starter-parent - 2.4.1 - + 3.2.6 + - 1.8 - 5.3.2 + 17 + 5.4.0 @@ -36,7 +36,7 @@ maven-failsafe-plugin - 2.22.2 + 3.2.5 @@ -74,11 +74,5 @@ spring-boot-starter-webflux test - - net.minidev - json-smart - 2.3 - test - diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml new file mode 100644 index 0000000..e6cf137 --- /dev/null +++ b/src/main/resources/application.yaml @@ -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 diff --git a/src/main/resources/hazelcast-local.yaml b/src/main/resources/hazelcast-local.yaml new file mode 100644 index 0000000..34ee506 --- /dev/null +++ b/src/main/resources/hazelcast-local.yaml @@ -0,0 +1,6 @@ +hazelcast: + cluster-name: hazelcast-cluster + network: + join: + multicast: + enabled: true diff --git a/src/main/resources/hazelcast.yaml b/src/main/resources/hazelcast.yaml index 627d281..326c4cc 100644 --- a/src/main/resources/hazelcast.yaml +++ b/src/main/resources/hazelcast.yaml @@ -1,2 +1,12 @@ hazelcast: - cluster-name: hazelcast-cluster \ No newline at end of file + network: + interfaces: + enabled: true + interfaces: + - 10.0.*.* + join: + multicast: + enabled: false + aws: + enabled: true + hz-port: 5701 \ No newline at end of file