Merge branch '2.7.x'

Closes gh-31884
pull/31887/head
Stephane Nicoll 2 years ago
commit c413f9adbe

@ -5,7 +5,7 @@
<map name="defaultCache" /> <map name="defaultCache" />
<network> <network>
<join> <join>
<tcp-ip enabled="false"/> <auto-detection enabled="false"/>
<multicast enabled="false"/> <multicast enabled="false"/>
</join> </join>
</network> </network>

@ -6,7 +6,7 @@
<map name="defaultCache" /> <map name="defaultCache" />
<network> <network>
<join> <join>
<tcp-ip enabled="false"/> <auto-detection enabled="false"/>
<multicast enabled="false"/> <multicast enabled="false"/>
</join> </join>
</network> </network>

@ -19,6 +19,7 @@ package org.springframework.boot.autoconfigure.hazelcast;
import java.util.Map; import java.util.Map;
import com.hazelcast.config.Config; import com.hazelcast.config.Config;
import com.hazelcast.config.JoinConfig;
import com.hazelcast.config.QueueConfig; import com.hazelcast.config.QueueConfig;
import com.hazelcast.core.Hazelcast; import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance; import com.hazelcast.core.HazelcastInstance;
@ -138,7 +139,7 @@ class HazelcastAutoConfigurationServerTests {
@Test @Test
void configInstanceWithName() { void configInstanceWithName() {
Config config = new Config("my-test-instance"); Config config = createTestConfig("my-test-instance");
HazelcastInstance existing = Hazelcast.newHazelcastInstance(config); HazelcastInstance existing = Hazelcast.newHazelcastInstance(config);
try { try {
this.contextRunner.withUserConfiguration(HazelcastConfigWithName.class) this.contextRunner.withUserConfiguration(HazelcastConfigWithName.class)
@ -205,6 +206,14 @@ class HazelcastAutoConfigurationServerTests {
}); });
} }
private static Config createTestConfig(String instanceName) {
Config config = new Config(instanceName);
JoinConfig join = config.getNetworkConfig().getJoin();
join.getAutoDetectionConfig().setEnabled(false);
join.getMulticastConfig().setEnabled(false);
return config;
}
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
static class HazelcastConfigWithName { static class HazelcastConfigWithName {
@ -220,7 +229,7 @@ class HazelcastAutoConfigurationServerTests {
@Bean @Bean
Config anotherHazelcastConfig() { Config anotherHazelcastConfig() {
Config config = new Config(); Config config = createTestConfig("another-test-instance");
config.addQueueConfig(new QueueConfig("another-queue")); config.addQueueConfig(new QueueConfig("another-queue"));
return config; return config;
} }

@ -5,7 +5,7 @@
<map name="defaultCache" /> <map name="defaultCache" />
<network> <network>
<join> <join>
<tcp-ip enabled="false" /> <auto-detection enabled="false" />
<multicast enabled="false" /> <multicast enabled="false" />
</join> </join>
</network> </network>

@ -1,5 +1,7 @@
hazelcast: hazelcast:
network: network:
join: join:
auto-detection:
enabled: false
multicast: multicast:
enabled: false enabled: false

@ -11,7 +11,7 @@
<network> <network>
<join> <join>
<tcp-ip enabled="false"/> <auto-detection enabled="false" />
<multicast enabled="false"/> <multicast enabled="false"/>
</join> </join>
</network> </network>

@ -1,6 +1,8 @@
hazelcast: hazelcast:
network: network:
join: join:
auto-detection:
enabled: false
multicast: multicast:
enabled: false enabled: false

@ -1,7 +1,7 @@
<hazelcast xmlns="http://www.hazelcast.com/schema/config" <hazelcast xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.hazelcast.com/schema/config xsi:schemaLocation="http://www.hazelcast.com/schema/config
http://www.hazelcast.com/schema/config/hazelcast-config-4.0.xsd"> http://www.hazelcast.com/schema/config/hazelcast-config-4.2.xsd">
<map name="spring:session:sessions"> <map name="spring:session:sessions">
<attributes> <attributes>
@ -11,6 +11,7 @@
<network> <network>
<join> <join>
<auto-detection enabled="false"/>
<multicast enabled="false"/> <multicast enabled="false"/>
</join> </join>
</network> </network>

Loading…
Cancel
Save