mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Merge branch '2.7.x'
Closes gh-31884
This commit is contained in:
commit
c413f9adbe
@ -5,7 +5,7 @@
|
||||
<map name="defaultCache" />
|
||||
<network>
|
||||
<join>
|
||||
<tcp-ip enabled="false"/>
|
||||
<auto-detection enabled="false"/>
|
||||
<multicast enabled="false"/>
|
||||
</join>
|
||||
</network>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<map name="defaultCache" />
|
||||
<network>
|
||||
<join>
|
||||
<tcp-ip enabled="false"/>
|
||||
<auto-detection enabled="false"/>
|
||||
<multicast enabled="false"/>
|
||||
</join>
|
||||
</network>
|
||||
|
@ -19,6 +19,7 @@ package org.springframework.boot.autoconfigure.hazelcast;
|
||||
import java.util.Map;
|
||||
|
||||
import com.hazelcast.config.Config;
|
||||
import com.hazelcast.config.JoinConfig;
|
||||
import com.hazelcast.config.QueueConfig;
|
||||
import com.hazelcast.core.Hazelcast;
|
||||
import com.hazelcast.core.HazelcastInstance;
|
||||
@ -138,7 +139,7 @@ class HazelcastAutoConfigurationServerTests {
|
||||
|
||||
@Test
|
||||
void configInstanceWithName() {
|
||||
Config config = new Config("my-test-instance");
|
||||
Config config = createTestConfig("my-test-instance");
|
||||
HazelcastInstance existing = Hazelcast.newHazelcastInstance(config);
|
||||
try {
|
||||
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)
|
||||
static class HazelcastConfigWithName {
|
||||
|
||||
@ -220,7 +229,7 @@ class HazelcastAutoConfigurationServerTests {
|
||||
|
||||
@Bean
|
||||
Config anotherHazelcastConfig() {
|
||||
Config config = new Config();
|
||||
Config config = createTestConfig("another-test-instance");
|
||||
config.addQueueConfig(new QueueConfig("another-queue"));
|
||||
return config;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<map name="defaultCache" />
|
||||
<network>
|
||||
<join>
|
||||
<tcp-ip enabled="false" />
|
||||
<auto-detection enabled="false" />
|
||||
<multicast enabled="false" />
|
||||
</join>
|
||||
</network>
|
||||
|
@ -1,5 +1,7 @@
|
||||
hazelcast:
|
||||
network:
|
||||
join:
|
||||
auto-detection:
|
||||
enabled: false
|
||||
multicast:
|
||||
enabled: false
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
<network>
|
||||
<join>
|
||||
<tcp-ip enabled="false"/>
|
||||
<auto-detection enabled="false" />
|
||||
<multicast enabled="false"/>
|
||||
</join>
|
||||
</network>
|
||||
|
@ -1,6 +1,8 @@
|
||||
hazelcast:
|
||||
network:
|
||||
join:
|
||||
auto-detection:
|
||||
enabled: false
|
||||
multicast:
|
||||
enabled: false
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<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-4.0.xsd">
|
||||
http://www.hazelcast.com/schema/config/hazelcast-config-4.2.xsd">
|
||||
|
||||
<map name="spring:session:sessions">
|
||||
<attributes>
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
<network>
|
||||
<join>
|
||||
<auto-detection enabled="false"/>
|
||||
<multicast enabled="false"/>
|
||||
</join>
|
||||
</network>
|
||||
|
Loading…
Reference in New Issue
Block a user