Jetty 10 Upgrade to Hazelcast 5 and totally disable auto join multicast etc.. (fix build on CI) (#9331)

* upgrade to hazelcast 5.2.1

Signed-off-by: Olivier Lamy <olamy@apache.org
This commit is contained in:
Olivier Lamy 2023-02-09 18:10:22 +10:00 committed by GitHub
parent 40f7fc8510
commit bd4cf3c835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 16 deletions

View File

@ -108,6 +108,7 @@ public class TestHazelcastSessions
SessionContext sessionContext = new SessionContext("foo", null);
hazelcastSessionDataStoreFactory = new HazelcastSessionDataStoreFactory();
hazelcastSessionDataStoreFactory.setConfigurationLocation("target/test-classes/hazelcast-test-config.xml");
hazelcastSessionDataStore = (HazelcastSessionDataStore)hazelcastSessionDataStoreFactory.getSessionDataStore(
context.getSessionHandler());
hazelcastSessionDataStore.initialize(sessionContext);

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<hazelcast xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.hazelcast.com/schema/config
http://www.hazelcast.com/schema/config/hazelcast-config-5.2.xsd">
<!--
Specifies the cluster name. It allows creating separate sub-clusters with different names.
The name is also referenced in the WAN Replication configuration.
-->
<cluster-name>my-cluster</cluster-name>
<instance-name>hzInstance1</instance-name>
<network>
<join>
<auto-detection enabled="false"/>
</join>
</network>
</hazelcast>

View File

@ -51,7 +51,7 @@
<guice.version>5.1.0</guice.version>
<hamcrest.version>2.2</hamcrest.version>
<hawtio.version>2.15.2</hawtio.version>
<hazelcast.version>4.2.5</hazelcast.version>
<hazelcast.version>5.2.1</hazelcast.version>
<infinispan.protostream.version>4.6.0.Final</infinispan.protostream.version>
<infinispan.version>11.0.17.Final</infinispan.version>
<jackson.version>2.14.1</jackson.version>

View File

@ -43,8 +43,15 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED</argLine>
<argLine>
--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
</argLine>
<useSystemClassLoader>true</useSystemClassLoader>
<systemPropertyVariables>
<hazelcast.logging.class>com.hazelcast.logging.Slf4jFactory</hazelcast.logging.class>
</systemPropertyVariables>
<forkedProcessExitTimeoutInSeconds>45</forkedProcessExitTimeoutInSeconds>
<forkedProcessTimeoutInSeconds>240</forkedProcessTimeoutInSeconds>
</configuration>
@ -76,16 +83,10 @@
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-hazelcast</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-all</artifactId>
<artifactId>hazelcast</artifactId>
<version>${hazelcast.version}</version>
</dependency>
<dependency>

View File

@ -19,10 +19,7 @@ import com.hazelcast.client.HazelcastClient;
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.client.config.ClientNetworkConfig;
import com.hazelcast.config.Config;
import com.hazelcast.config.JoinConfig;
import com.hazelcast.config.MapConfig;
import com.hazelcast.config.MulticastConfig;
import com.hazelcast.config.NetworkConfig;
import com.hazelcast.config.SerializerConfig;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
@ -45,9 +42,6 @@ public class HazelcastTestHelper
static
{
// Wire up hazelcast logging to slf4j
System.setProperty("hazelcast.logging.class", "com.hazelcast.logging.Slf4jFactory");
// Wire up java.util.logging (used by hazelcast libs) to slf4j.
if (!org.slf4j.bridge.SLF4JBridgeHandler.isInstalled())
{
@ -57,7 +51,7 @@ public class HazelcastTestHelper
_serializerConfig = new SerializerConfig().setImplementation(new SessionDataSerializer()).setTypeClass(SessionData.class);
Config config = new Config();
config.setInstanceName(_hazelcastInstanceName);
config.setNetworkConfig(new NetworkConfig().setJoin(new JoinConfig().setMulticastConfig(new MulticastConfig().setEnabled(false))));
config.getNetworkConfig().getJoin().getAutoDetectionConfig().setEnabled(false);
config.addMapConfig(new MapConfig().setName(_name)).setClassLoader(null);
config.getSerializationConfig().addSerializerConfig(_serializerConfig);
_instance = Hazelcast.getOrCreateHazelcastInstance(config);