Skip to content

Commit

Permalink
Working example for Hazelcast with JCache
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcGiffing committed Jul 7, 2022
1 parent de32a0b commit d26188a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
11 changes: 3 additions & 8 deletions examples/hazelcast/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,12 @@
<artifactId>bucket4j-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-spring</artifactId>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-client</artifactId>
<version>3.12.12</version>
<artifactId>hazelcast</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
10 changes: 3 additions & 7 deletions examples/hazelcast/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
management:
security:
enabled: false
debug: true
spring:
main: allow-bean-definition-overriding: true
cache:
type: jcache
jcache:
provider: com.hazelcast.cache.impl.HazelcastServerCachingProvider
config: classpath:hazelcast.xml
jcache: provider: com.hazelcast.cache.impl.HazelcastServerCachingProvider
main: allow-bean-definition-overriding: true
bucket4j:
enabled: true
filters:
Expand Down
22 changes: 6 additions & 16 deletions examples/hazelcast/src/main/resources/hazelcast.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.1.xsd">

<map name="buckets">
<time-to-live-seconds>120</time-to-live-seconds>
<in-memory-format>BINARY</in-memory-format>
<metadata-policy>CREATE_ON_UPDATE</metadata-policy>
<statistics-enabled>true</statistics-enabled>
</map>

<cache name="buckets">
</cache>

<hazelcast
xsi:schemaLocation="https://www.hazelcast.com/schema/config hazelcast-config-5.1.xsd"
xmlns="http://www.hazelcast.com/schema/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<cache name="buckets">
<management-enabled>true</management-enabled>
</cache>
</hazelcast>

0 comments on commit d26188a

Please sign in to comment.