Skip to content

thecitysecretltd/ChronicleCollectionSpringUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chronicle Collections Spring Utils

Chronicle Map

Chronicle Maps can be configured by setting properties in Spring. These properties correspond with the properties the ChronicleMapBuilder class uses to create and configure a ChronicleMap.

This is all you need to create a fully configured Chronicle Map
---
<bean id="map" class="com.thecitysecret.util.spring.chronicle.ChronicleMapFactoryBean">
    <constructor-arg name="keyClass" value="java.lang.Integer"/>
    <constructor-arg name="valueClass" value="java.lang.String"/>
</bean>
---
In memory map
---
<bean id="map" class="com.thecitysecret.util.spring.chronicle.ChronicleMapFactoryBean">
    <constructor-arg name="keyClass" value="java.lang.Integer"/>
    <constructor-arg name="valueClass" value="java.lang.String"/>
    <property name="entries" value="3000000"/>
</bean>
---
Map persisted to file
---
<bean id="map" class="com.thecitysecret.util.spring.chronicle.ChronicleMapFactoryBean">
    <constructor-arg name="keyClass" value="java.lang.Integer"/>
    <constructor-arg name="valueClass" value="java.lang.String"/>
    <property name="entries" value="3000000"/>
    <property name="dataFilePath" value="/my/data/file/path"/>
</bean>
---

The ChronicleMapBuilder documentation can be found here:

Chronicle Queue

Chronicle Queues can also be configured by setting properties in Spring. These properties correspond with the properties the ChronicleQueueBuilder (Indexed & Vanilla) class uses to create and configure a ChronicleQueue. Both builders require a String file path to be created.

This is the most basic setup needed to create a Chronicle Queue (the INDEXED value can be changed to VANILLA)
---
<bean id="queue" class="com.thecitysecret.util.spring.chronicle.ChronicleQueueFactoryBean">
    <property name="path" value="/a/file/path"/>
    <property name="queueType" value="INDEXED"/>
</bean>
---
The queue can be configured by passing properties to the queue bean e.g. cacheLineSize
---
<bean id="queue" class="com.thecitysecret.util.spring.chronicle.ChronicleQueueFactoryBean">
    <property name="path" value="/a/file/path"/>
    <property name="queueType" value="VANILLA"/>
    <property name="cacheLineSize" value="128"/>
</bean>
---

The ChronicleQueueBuilder documentation can be found here:

About

Bean Factories for configuring Chronicle collections in Spring

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages