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 39
39
<artifactId >spring-boot-starter-web</artifactId >
40
40
</dependency >
41
41
42
- <!-- <dependency>
43
- <groupId>com.hazelcast</groupId>
44
- <artifactId>hazelcast</artifactId>
45
- <version>${hazelcast.version}</version>
46
- </dependency>-->
47
42
<dependency >
48
43
<groupId >com.hazelcast</groupId >
49
44
<artifactId >hazelcast-spring</artifactId >
55
50
<artifactId >hazelcast-hibernate53</artifactId >
56
51
<version >${hazelcast-hibernate53.version} </version >
57
52
</dependency >
58
- <dependency >
59
- <groupId >com.hazelcast</groupId >
60
- <artifactId >hazelcast-client</artifactId >
61
- <version >${hazelcast-client.version} </version >
62
- </dependency >
63
53
64
54
<dependency >
65
55
<groupId >com.h2database</groupId >
Original file line number Diff line number Diff line change 1
1
package com .pj .hazelcastdemo ;
2
2
3
- import com .hazelcast .client .HazelcastClient ;
4
- import com .hazelcast .client .config .ClientConfig ;
5
3
import org .springframework .boot .SpringApplication ;
6
4
import org .springframework .boot .autoconfigure .SpringBootApplication ;
7
5
@@ -10,14 +8,6 @@ public class HazelcastDemoApplication
10
8
{
11
9
public static void main (String [] args )
12
10
{
13
- connectToHazelcastClient ();
14
11
SpringApplication .run (HazelcastDemoApplication .class , args );
15
12
}
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
- }
23
13
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
package com .pj .hazelcastdemo .config ;
2
2
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 ;
4
6
import org .springframework .context .annotation .Configuration ;
5
7
6
8
@ Configuration
7
9
public class HazelCastConfig
8
10
{
9
- // @Bean
10
- public ClientConfig hazelCastConfig ()
11
+ @ Bean
12
+ public Config config ()
11
13
{
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 ;
15
20
}
16
21
}
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