Абсолютный Hazelcast newb ie здесь. Вдохновленный этим , я создал минимальное приложение Spring Boot и пытаюсь реплицировать сеанс с помощью Hazelcast. Я добавил это в мой файл pom. xml:
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-all</artifactId>
<version>3.12.5</version>
</dependency>
И создал этот файл конфигурации:
@Configuration
public class HazelcastConfiguration {
@Bean
public Config config() {
Config config = new Config();
JoinConfig joinConfig = config.getNetworkConfig().getJoin();
joinConfig.getMulticastConfig().setEnabled(false);
joinConfig.getTcpIpConfig().setEnabled(true).setMembers(singletonList("127.0.0.1"));
return config;
}
@Bean
public WebFilter webFilter(HazelcastInstance hazelcastInstance) {
Properties properties = new Properties();
properties.put("instance-name", hazelcastInstance.getName());
properties.put("sticky-session", "false");
return new WebFilter(properties);
}
}
Когда я запускаю один (или несколько) экземпляров приложения, я получите это на консоли:
2020-01-23 17:49:02.318 INFO 24304 --- [cached.thread-2] com.hazelcast.nio.tcp.TcpIpConnector : [127.0.0.1]:5701 [dev] [3.12.5] Connecting to /127.0.0.1:5702, timeout: 10000, bind-any: true
2020-01-23 17:49:02.323 WARN 24304 --- [.IO.thread-in-1] com.hazelcast.nio.tcp.TcpIpConnection : [127.0.0.1]:5701 [dev] [3.12.5] Connection[id=10, /127.0.0.1:59818->/127.0.0.1:5702, qualifier=null, endpoint=[127.0.0.1]:5702, alive=false, type=NONE] closed. Reason: Exception in Connection[id=10, /127.0.0.1:59818->/127.0.0.1:5702, qualifier=null, endpoint=[127.0.0.1]:5702, alive=true, type=NONE], thread=hz._hzInstance_1_dev.IO.thread-in-1
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[na:1.8.0_192]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[na:1.8.0_192]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_192]
at sun.nio.ch.IOUtil.read(IOUtil.java:197) ~[na:1.8.0_192]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) ~[na:1.8.0_192]
at com.hazelcast.internal.networking.nio.NioInboundPipeline.process(NioInboundPipeline.java:113) ~[hazelcast-all-3.12.5.jar:3.12.5]
at com.hazelcast.internal.networking.nio.NioThread.processSelectionKey(NioThread.java:369) [hazelcast-all-3.12.5.jar:3.12.5]
at com.hazelcast.internal.networking.nio.NioThread.processSelectionKeys(NioThread.java:354) [hazelcast-all-3.12.5.jar:3.12.5]
at com.hazelcast.internal.networking.nio.NioThread.selectLoop(NioThread.java:280) [hazelcast-all-3.12.5.jar:3.12.5]
at com.hazelcast.internal.networking.nio.NioThread.run(NioThread.java:235) [hazelcast-all-3.12.5.jar:3.12.5]
Что я делаю не так?