File tree Expand file tree Collapse file tree 7 files changed +28
-85
lines changed
java/com/pj/hazelcastdemo Expand file tree Collapse file tree 7 files changed +28
-85
lines changed Original file line number Diff line number Diff line change 3939 <artifactId >spring-boot-starter-web</artifactId >
4040 </dependency >
4141
42- <!-- <dependency>
43- <groupId>com.hazelcast</groupId>
44- <artifactId>hazelcast</artifactId>
45- <version>${hazelcast.version}</version>
46- </dependency>-->
4742 <dependency >
4843 <groupId >com.hazelcast</groupId >
4944 <artifactId >hazelcast-spring</artifactId >
5550 <artifactId >hazelcast-hibernate53</artifactId >
5651 <version >${hazelcast-hibernate53.version} </version >
5752 </dependency >
58- <dependency >
59- <groupId >com.hazelcast</groupId >
60- <artifactId >hazelcast-client</artifactId >
61- <version >${hazelcast-client.version} </version >
62- </dependency >
6353
6454 <dependency >
6555 <groupId >com.h2database</groupId >
Original file line number Diff line number Diff line change 11package com .pj .hazelcastdemo ;
22
3- import com .hazelcast .client .HazelcastClient ;
4- import com .hazelcast .client .config .ClientConfig ;
53import org .springframework .boot .SpringApplication ;
64import org .springframework .boot .autoconfigure .SpringBootApplication ;
75
@@ -10,14 +8,6 @@ public class HazelcastDemoApplication
108{
119 public static void main (String [] args )
1210 {
13- connectToHazelcastClient ();
1411 SpringApplication .run (HazelcastDemoApplication .class , args );
1512 }
16-
17- private static void connectToHazelcastClient ()
18- {
19- ClientConfig clientConfig = new ClientConfig ();
20- clientConfig .getNetworkConfig ().addAddress ("127.0.0.1" );
21- HazelcastClient .newHazelcastClient (clientConfig );
22- }
2313}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11package com .pj .hazelcastdemo .config ;
22
3- import com .hazelcast .client .config .ClientConfig ;
3+ import com .hazelcast .config .Config ;
4+ import com .hazelcast .config .NetworkConfig ;
5+ import org .springframework .context .annotation .Bean ;
46import org .springframework .context .annotation .Configuration ;
57
68@ Configuration
79public class HazelCastConfig
810{
9- // @Bean
10- public ClientConfig hazelCastConfig ()
11+ @ Bean
12+ public Config config ()
1113 {
12- ClientConfig clientConfig = new ClientConfig ();
13- return clientConfig ;
14- //Hazelcast.newHazelcastInstance(cfg);
14+ NetworkConfig networkConfig = new NetworkConfig ();
15+ networkConfig .setPublicAddress ("192.168.1.157" ).addOutboundPort (9701 );
16+ networkConfig .setPublicAddress ("192.168.1.157" ).addOutboundPort (9702 );
17+ Config config = new Config ();
18+ config .setNetworkConfig (networkConfig );
19+ return config ;
1520 }
1621}
Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ hazelcast:
2+ group:
3+ name: 'hazelcastdemo'
4+ management-center:
5+ enabled: true
6+ url: 'http://localhost:8090/hazelcast-mancenter'
7+ network:
8+ port:
9+ port: 9701
10+ join:
11+ multicast:
12+ enabled: false
13+ tcp-ip:
14+ enabled: true
15+ member-list:
16+ - 192.168.1.157:9701
17+ - 192.168.1.157:9702
You can’t perform that action at this time.
0 commit comments