Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
c6ef5dbb
Commit
c6ef5dbb
authored
Aug 16, 2014
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hazelcast Java config
parent
7553b35e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
290 additions
and
144 deletions
+290
-144
src/main/java/org/genesys2/spring/config/HazelcastConfig.java
...main/java/org/genesys2/spring/config/HazelcastConfig.java
+57
-0
src/main/java/org/genesys2/spring/config/HazelcastConfigAWS.java
...n/java/org/genesys2/spring/config/HazelcastConfigAWS.java
+107
-0
src/main/java/org/genesys2/spring/config/HazelcastConfigDev.java
...n/java/org/genesys2/spring/config/HazelcastConfigDev.java
+93
-0
src/main/java/org/genesys2/spring/config/SpringCacheConfig.java
...in/java/org/genesys2/spring/config/SpringCacheConfig.java
+29
-3
src/main/java/org/genesys2/spring/config/SpringServletConfig.java
.../java/org/genesys2/spring/config/SpringServletConfig.java
+3
-3
src/main/resources/hazelcast.xml
src/main/resources/hazelcast.xml
+0
-22
src/main/resources/spring/spring-cache.xml
src/main/resources/spring/spring-cache.xml
+0
-116
src/main/resources/spring/spring.properties
src/main/resources/spring/spring.properties
+1
-0
No files found.
src/main/java/org/genesys2/spring/config/HazelcastConfig.java
0 → 100644
View file @
c6ef5dbb
/**
* Copyright 2014 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package
org.genesys2.spring.config
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
com.hazelcast.config.MapConfig.EvictionPolicy
;
import
com.hazelcast.core.HazelcastInstance
;
import
com.hazelcast.core.ManagedContext
;
import
com.hazelcast.spring.context.SpringManagedContext
;
@Configuration
@EnableCaching
@Import
({
HazelcastConfigDev
.
class
,
HazelcastConfigAWS
.
class
})
public
abstract
class
HazelcastConfig
{
@Value
(
"${hazelcast.port}"
)
protected
int
hazelPort
;
@Value
(
"${hazelcast.instanceName}"
)
protected
String
instanceName
=
"genesys"
;
@Value
(
"${hazelcast.password}"
)
protected
String
password
;
@Value
(
"${hazelcast.name}"
)
protected
String
name
;
@Value
(
"${cache.tileserver.max-size}"
)
protected
int
tileserverMaxSize
;
@Value
(
"${cache.tileserver.max-idle-seconds}"
)
protected
int
tileserverMaxIdle
;
@Value
(
"${cache.tileserver.time-to-live-seconds}"
)
protected
int
tileserverTTL
;
@Value
(
"${cache.tileserver.eviction-policy}"
)
protected
EvictionPolicy
tileserverEvictionPolicy
;
@Bean
public
ManagedContext
managedContext
()
{
return
new
SpringManagedContext
();
}
}
src/main/java/org/genesys2/spring/config/HazelcastConfigAWS.java
0 → 100644
View file @
c6ef5dbb
/**
* Copyright 2014 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package
org.genesys2.spring.config
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Profile
;
import
com.hazelcast.config.AwsConfig
;
import
com.hazelcast.config.Config
;
import
com.hazelcast.config.ExecutorConfig
;
import
com.hazelcast.config.GroupConfig
;
import
com.hazelcast.config.JoinConfig
;
import
com.hazelcast.config.MapConfig
;
import
com.hazelcast.config.MaxSizeConfig
;
import
com.hazelcast.config.MaxSizeConfig.MaxSizePolicy
;
import
com.hazelcast.config.NetworkConfig
;
import
com.hazelcast.config.QueueConfig
;
import
com.hazelcast.core.Hazelcast
;
import
com.hazelcast.core.HazelcastInstance
;
import
com.hazelcast.core.ManagedContext
;
@Configuration
@Profile
(
"aws"
)
public
class
HazelcastConfigAWS
extends
HazelcastConfig
{
@Value
(
"${hazelcast.aws.region}"
)
private
String
region
;
@Value
(
"${hazelcast.aws.access-key}"
)
private
String
accessKey
;
@Value
(
"${hazelcast.aws.secret-key}"
)
private
String
secretKey
;
@Value
(
"${hazelcast.aws.security-group}"
)
private
String
securityGroupName
;
@Bean
public
HazelcastInstance
hazelcast
(
ManagedContext
managedContext
)
{
Config
cfg
=
new
Config
();
cfg
.
setManagedContext
(
managedContext
);
cfg
.
setInstanceName
(
instanceName
);
GroupConfig
groupConfig
=
cfg
.
getGroupConfig
();
groupConfig
.
setName
(
name
);
groupConfig
.
setPassword
(
password
);
cfg
.
setProperty
(
"hazelcast.merge.first.run.delay.seconds"
,
"5"
);
cfg
.
setProperty
(
"hazelcast.merge.next.run.delay.seconds"
,
"5"
);
cfg
.
setProperty
(
"hazelcast.logging.type"
,
"log4j"
);
cfg
.
setProperty
(
"hazelcast.icmp.enabled"
,
"true"
);
NetworkConfig
network
=
cfg
.
getNetworkConfig
();
network
.
setPort
(
hazelPort
);
network
.
setPortAutoIncrement
(
false
);
JoinConfig
join
=
network
.
getJoin
();
join
.
getMulticastConfig
().
setEnabled
(
false
);
AwsConfig
awsConfig
=
join
.
getAwsConfig
();
awsConfig
.
setEnabled
(
true
);
awsConfig
.
setRegion
(
region
);
awsConfig
.
setAccessKey
(
accessKey
);
awsConfig
.
setSecretKey
(
secretKey
);
awsConfig
.
setConnectionTimeoutSeconds
(
20
);
awsConfig
.
setSecurityGroupName
(
securityGroupName
);
MapConfig
tileserverMapConfig
=
new
MapConfig
();
tileserverMapConfig
.
setName
(
"tileserver"
);
tileserverMapConfig
.
setTimeToLiveSeconds
(
tileserverTTL
);
tileserverMapConfig
.
setEvictionPolicy
(
tileserverEvictionPolicy
);
tileserverMapConfig
.
setMaxIdleSeconds
(
tileserverMaxIdle
);
MaxSizeConfig
tileserverMaxSizeConfig
=
new
MaxSizeConfig
();
tileserverMaxSizeConfig
.
setSize
(
tileserverMaxSize
);
tileserverMaxSizeConfig
.
setMaxSizePolicy
(
MaxSizePolicy
.
PER_NODE
);
tileserverMapConfig
.
setMaxSizeConfig
(
tileserverMaxSizeConfig
);
cfg
.
addMapConfig
(
tileserverMapConfig
);
ExecutorConfig
execConfig
=
new
ExecutorConfig
();
execConfig
.
setName
(
"hazel-exec"
);
execConfig
.
setPoolSize
(
4
);
execConfig
.
setQueueCapacity
(
2
);
execConfig
.
setStatisticsEnabled
(
true
);
cfg
.
addExecutorConfig
(
execConfig
);
QueueConfig
queueConfig
=
new
QueueConfig
();
queueConfig
.
setName
(
"elasticsearchQueue"
);
queueConfig
.
setMaxSize
(
100
);
cfg
.
addQueueConfig
(
queueConfig
);
HazelcastInstance
instance
=
Hazelcast
.
newHazelcastInstance
(
cfg
);
return
instance
;
}
}
src/main/java/org/genesys2/spring/config/HazelcastConfigDev.java
0 → 100644
View file @
c6ef5dbb
/**
* Copyright 2014 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package
org.genesys2.spring.config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
com.hazelcast.config.Config
;
import
com.hazelcast.config.ExecutorConfig
;
import
com.hazelcast.config.GroupConfig
;
import
com.hazelcast.config.JoinConfig
;
import
com.hazelcast.config.MapConfig
;
import
com.hazelcast.config.MaxSizeConfig
;
import
com.hazelcast.config.MaxSizeConfig.MaxSizePolicy
;
import
com.hazelcast.config.NetworkConfig
;
import
com.hazelcast.config.QueueConfig
;
import
com.hazelcast.config.TcpIpConfig
;
import
com.hazelcast.core.Hazelcast
;
import
com.hazelcast.core.HazelcastInstance
;
import
com.hazelcast.core.ManagedContext
;
@Configuration
public
class
HazelcastConfigDev
extends
HazelcastConfig
{
@Bean
public
HazelcastInstance
hazelcast
(
ManagedContext
managedContext
)
{
Config
cfg
=
new
Config
();
cfg
.
setManagedContext
(
managedContext
);
cfg
.
setInstanceName
(
instanceName
);
GroupConfig
groupConfig
=
cfg
.
getGroupConfig
();
groupConfig
.
setName
(
name
);
groupConfig
.
setPassword
(
password
);
cfg
.
setProperty
(
"hazelcast.merge.first.run.delay.seconds"
,
"5"
);
cfg
.
setProperty
(
"hazelcast.merge.next.run.delay.seconds"
,
"5"
);
cfg
.
setProperty
(
"hazelcast.logging.type"
,
"log4j"
);
cfg
.
setProperty
(
"hazelcast.icmp.enabled"
,
"true"
);
NetworkConfig
network
=
cfg
.
getNetworkConfig
();
network
.
setPort
(
hazelPort
);
network
.
setPortAutoIncrement
(
false
);
JoinConfig
join
=
network
.
getJoin
();
join
.
getMulticastConfig
().
setEnabled
(
false
);
TcpIpConfig
tcpIpConfig
=
join
.
getTcpIpConfig
();
tcpIpConfig
.
setEnabled
(
true
);
tcpIpConfig
.
setConnectionTimeoutSeconds
(
20
);
// See if there's a local HZ running
tcpIpConfig
.
addMember
(
"127.0.0.1:5702"
);
MapConfig
tileserverMapConfig
=
new
MapConfig
();
tileserverMapConfig
.
setName
(
"tileserver"
);
tileserverMapConfig
.
setTimeToLiveSeconds
(
tileserverTTL
);
tileserverMapConfig
.
setEvictionPolicy
(
tileserverEvictionPolicy
);
tileserverMapConfig
.
setMaxIdleSeconds
(
tileserverMaxIdle
);
MaxSizeConfig
tileserverMaxSizeConfig
=
new
MaxSizeConfig
();
tileserverMaxSizeConfig
.
setSize
(
tileserverMaxSize
);
tileserverMaxSizeConfig
.
setMaxSizePolicy
(
MaxSizePolicy
.
PER_NODE
);
tileserverMapConfig
.
setMaxSizeConfig
(
tileserverMaxSizeConfig
);
cfg
.
addMapConfig
(
tileserverMapConfig
);
ExecutorConfig
execConfig
=
new
ExecutorConfig
();
execConfig
.
setName
(
"hazel-exec"
);
execConfig
.
setPoolSize
(
4
);
execConfig
.
setQueueCapacity
(
2
);
execConfig
.
setStatisticsEnabled
(
true
);
cfg
.
addExecutorConfig
(
execConfig
);
QueueConfig
queueConfig
=
new
QueueConfig
();
queueConfig
.
setName
(
"elasticsearchQueue"
);
queueConfig
.
setMaxSize
(
100
);
cfg
.
addQueueConfig
(
queueConfig
);
HazelcastInstance
instance
=
Hazelcast
.
newHazelcastInstance
(
cfg
);
return
instance
;
}
}
src/main/java/org/genesys2/spring/config/SpringCacheConfig.java
View file @
c6ef5dbb
...
@@ -22,14 +22,22 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -22,14 +22,22 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
Resource
;
import
org.springframework.context.annotation.Import
;
import
com.hazelcast.core.HazelcastInstance
;
import
com.hazelcast.core.IExecutorService
;
import
com.hazelcast.core.IMap
;
import
com.hazelcast.core.ManagedContext
;
import
com.hazelcast.spring.cache.HazelcastCacheManager
;
import
com.hazelcast.spring.context.SpringManagedContext
;
import
com.hazelcast.web.WebFilter
;
import
com.hazelcast.web.WebFilter
;
@Configuration
@Configuration
@EnableCaching
@EnableCaching
@Import
Resource
(
"classpath:/spring/spring-cache.xml"
)
@Import
({
HazelcastConfig
.
class
}
)
public
class
SpringCacheConfig
{
public
class
SpringCacheConfig
{
@Value
(
"${hazelcast.instanceName}"
)
protected
String
instanceName
=
"genesys"
;
@Value
(
"${base.cookie-domain}"
)
@Value
(
"${base.cookie-domain}"
)
private
String
cookieDomain
;
private
String
cookieDomain
;
...
@@ -39,6 +47,24 @@ public class SpringCacheConfig {
...
@@ -39,6 +47,24 @@ public class SpringCacheConfig {
@Value
(
"${base.cookie-http-only}"
)
@Value
(
"${base.cookie-http-only}"
)
private
String
cookieHttpOnly
;
private
String
cookieHttpOnly
;
@Bean
public
HazelcastCacheManager
cacheManager
(
HazelcastInstance
hazelcastInstance
)
{
HazelcastCacheManager
cm
=
new
HazelcastCacheManager
(
hazelcastInstance
);
return
cm
;
}
@Bean
public
IMap
<
Object
,
Object
>
tileserverMap
(
HazelcastInstance
hazelcast
)
{
IMap
<
Object
,
Object
>
x
=
hazelcast
.
getMap
(
"tileserver"
);
return
x
;
}
@Bean
public
IExecutorService
distributedExecutor
(
HazelcastInstance
hazelcast
)
{
IExecutorService
executorService
=
hazelcast
.
getExecutorService
(
"hazel-exec"
);
return
executorService
;
}
@Bean
@Bean
public
WebFilter
hazelcastWebFilter
()
{
public
WebFilter
hazelcastWebFilter
()
{
...
@@ -55,7 +81,7 @@ public class SpringCacheConfig {
...
@@ -55,7 +81,7 @@ public class SpringCacheConfig {
properties
.
setProperty
(
"cookie-secure"
,
cookieSecure
);
properties
.
setProperty
(
"cookie-secure"
,
cookieSecure
);
properties
.
setProperty
(
"cookie-http-only"
,
cookieHttpOnly
);
properties
.
setProperty
(
"cookie-http-only"
,
cookieHttpOnly
);
properties
.
setProperty
(
"debug"
,
"true"
);
properties
.
setProperty
(
"debug"
,
"true"
);
properties
.
setProperty
(
"instance-name"
,
"genesys"
);
properties
.
setProperty
(
"instance-name"
,
instanceName
);
properties
.
setProperty
(
"shutdown-on-destroy"
,
"true"
);
properties
.
setProperty
(
"shutdown-on-destroy"
,
"true"
);
return
properties
;
return
properties
;
}
}
...
...
src/main/java/org/genesys2/spring/config/SpringServletConfig.java
View file @
c6ef5dbb
...
@@ -54,10 +54,10 @@ public class SpringServletConfig extends WebMvcConfigurerAdapter {
...
@@ -54,10 +54,10 @@ public class SpringServletConfig extends WebMvcConfigurerAdapter {
@Value
(
"${theme.defaultThemeName}"
)
@Value
(
"${theme.defaultThemeName}"
)
private
String
defaultThemeName
;
private
String
defaultThemeName
;
@Autowired
@Autowired
private
AddStuffInterceptor
addStuffInterceptor
;
private
AddStuffInterceptor
addStuffInterceptor
;
@Override
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
super
.
addResourceHandlers
(
registry
);
super
.
addResourceHandlers
(
registry
);
...
@@ -134,7 +134,7 @@ public class SpringServletConfig extends WebMvcConfigurerAdapter {
...
@@ -134,7 +134,7 @@ public class SpringServletConfig extends WebMvcConfigurerAdapter {
supportedLocales
.
add
(
"pt"
);
supportedLocales
.
add
(
"pt"
);
supportedLocales
.
add
(
"ru"
);
supportedLocales
.
add
(
"ru"
);
supportedLocales
.
add
(
"zh"
);
supportedLocales
.
add
(
"zh"
);
supportedLocales
.
add
(
"sl"
);
//
supportedLocales.add("sl");
final
BetterSessionLocaleResolver
resolver
=
new
BetterSessionLocaleResolver
();
final
BetterSessionLocaleResolver
resolver
=
new
BetterSessionLocaleResolver
();
resolver
.
setDefaultLocale
(
Locale
.
forLanguageTag
(
"en"
));
resolver
.
setDefaultLocale
(
Locale
.
forLanguageTag
(
"en"
));
...
...
src/main/resources/hazelcast.xml
deleted
100644 → 0
View file @
7553b35e
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<hazelcast
xsi:schemaLocation=
"http://www.hazelcast.com/schema/config hazelcast-config-3.1.xsd"
xmlns=
"http://www.hazelcast.com/schema/config"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
</hazelcast>
src/main/resources/spring/spring-cache.xml
deleted
100644 → 0
View file @
7553b35e
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2014 Global Crop Diversity Trust
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:cache=
"http://www.springframework.org/schema/cache"
xmlns:hz=
"http://www.hazelcast.com/schema/spring"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache-3.2.xsd
http://www.hazelcast.com/schema/spring
http://www.hazelcast.com/schema/spring/hazelcast-spring-3.1.xsd"
>
<beans
profile=
"aws"
>
<hz:hazelcast
id=
"theHazelcast"
>
<hz:config>
<hz:instance-name>
genesys
</hz:instance-name>
<hz:group
name=
"${hazelcast.name}"
password=
"${hazelcast.password}"
/>
<hz:properties>
<hz:property
name=
"hazelcast.merge.first.run.delay.seconds"
>
5
</hz:property>
<hz:property
name=
"hazelcast.merge.next.run.delay.seconds"
>
5
</hz:property>
<hz:property
name=
"hazelcast.logging.type"
>
log4j
</hz:property>
<hz:property
name=
"hazelcast.icmp.enabled"
>
true
</hz:property>
</hz:properties>
<hz:network
port=
"${hazelcast.port}"
port-auto-increment=
"false"
>
<hz:join>
<hz:multicast
enabled=
"false"
/>
<hz:tcp-ip
connection-timeout-seconds=
"20"
enabled=
"false"
/>
<hz:aws
connection-timeout-seconds=
"5"
enabled=
"true"
access-key=
"${hazelcast.aws.access-key}"
region=
"${hazelcast.aws.region}"
secret-key=
"${hazelcast.aws.secret-key}"
security-group-name=
"${hazelcast.aws.security-group}"
/>
</hz:join>
</hz:network>
<hz:map
name=
"default"
max-idle-seconds=
"3600"
max-size=
"5000"
time-to-live-seconds=
"0"
eviction-policy=
"LRU"
/>
<hz:map
name=
"tileserver"
max-size=
"${cache.tileserver.max-size}"
max-idle-seconds=
"${cache.tileserver.max-idle-seconds}"
time-to-live-seconds=
"${cache.tileserver.time-to-live-seconds}"
eviction-policy=
"${cache.tileserver.eviction-policy}"
/>
</hz:config>
</hz:hazelcast>
<bean
id=
"hzCacheManager"
class=
"com.hazelcast.spring.cache.HazelcastCacheManager"
>
<constructor-arg
ref=
"theHazelcast"
/>
</bean>
</beans>
<beans
profile=
"cacher"
>
<hz:hazelcast
id=
"theHazelcast"
>
<hz:config>
<hz:instance-name>
genesys
</hz:instance-name>
<hz:group
name=
"${hazelcast.name}"
password=
"${hazelcast.password}"
/>
<hz:properties>
<hz:property
name=
"hazelcast.merge.first.run.delay.seconds"
>
5
</hz:property>
<hz:property
name=
"hazelcast.merge.next.run.delay.seconds"
>
5
</hz:property>
<hz:property
name=
"hazelcast.logging.type"
>
log4j
</hz:property>
</hz:properties>
<hz:network
port=
"${hazelcast.port}"
port-auto-increment=
"false"
>
<hz:join>
<hz:multicast
enabled=
"false"
/>
<hz:tcp-ip
enabled=
"true"
>
<hz:required-member>
127.0.0.1:5702
</hz:required-member>
</hz:tcp-ip>
</hz:join>
</hz:network>
<hz:map
name=
"default"
max-idle-seconds=
"300"
max-size=
"1000"
time-to-live-seconds=
"0"
eviction-policy=
"LRU"
/>
<hz:map
name=
"tileserver"
max-size=
"${cache.tileserver.max-size}"
max-idle-seconds=
"${cache.tileserver.max-idle-seconds}"
time-to-live-seconds=
"${cache.tileserver.time-to-live-seconds}"
eviction-policy=
"${cache.tileserver.eviction-policy}"
/>
</hz:config>
</hz:hazelcast>
<bean
id=
"hzCacheManager"
class=
"com.hazelcast.spring.cache.HazelcastCacheManager"
>
<constructor-arg
ref=
"theHazelcast"
/>
</bean>
</beans>
<beans
profile=
"dev"
>
<hz:hazelcast
id=
"theHazelcast"
>
<hz:config>
<hz:instance-name>
genesys
</hz:instance-name>
<hz:group
name=
"${hazelcast.name}"
password=
"${hazelcast.password}"
/>
<hz:properties>
<hz:property
name=
"hazelcast.merge.first.run.delay.seconds"
>
5
</hz:property>
<hz:property
name=
"hazelcast.merge.next.run.delay.seconds"
>
5
</hz:property>
<hz:property
name=
"hazelcast.logging.type"
>
log4j
</hz:property>
</hz:properties>
<hz:network
port=
"${hazelcast.port}"
port-auto-increment=
"false"
>
<hz:join>
<hz:multicast
enabled=
"false"
/>
<hz:tcp-ip
enabled=
"false"
/>
</hz:join>
</hz:network>
<hz:map
name=
"default"
max-idle-seconds=
"300"
max-size=
"1000"
time-to-live-seconds=
"0"
eviction-policy=
"LRU"
/>
<hz:map
name=
"tileserver"
max-size=
"${cache.tileserver.max-size}"
max-idle-seconds=
"${cache.tileserver.max-idle-seconds}"
time-to-live-seconds=
"${cache.tileserver.time-to-live-seconds}"
eviction-policy=
"${cache.tileserver.eviction-policy}"
/>
</hz:config>
</hz:hazelcast>
<bean
id=
"hzCacheManager"
class=
"com.hazelcast.spring.cache.HazelcastCacheManager"
>
<constructor-arg
ref=
"theHazelcast"
/>
</bean>
</beans>
</beans>
src/main/resources/spring/spring.properties
View file @
c6ef5dbb
...
@@ -98,6 +98,7 @@ executor.queue.capacity=100
...
@@ -98,6 +98,7 @@ executor.queue.capacity=100
scheduler.max.pool.size
=
16
scheduler.max.pool.size
=
16
# Hazelcast
# Hazelcast
hazelcast.instanceName
=
genesys
hazelcast.name
=
genesys
hazelcast.name
=
genesys
hazelcast.password
=
hazelcasts
hazelcast.password
=
hazelcasts
hazelcast.port
=
5701
hazelcast.port
=
5701
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment