SubZero provides fast & non-invasive serialization for Hazelcast. It's easy-to-use integration of fast serialization libraries such as Kryo into Hazelcast.
SubZero will completely replace Java serialization. Hazelcast internal serializers will still take precedence.
Insert this snippet into your Hazelcast configuration XML:
<serialization>
<serializers>
<global-serializer override-java-serialization="true">
info.jerrinot.subzero.Serializer
</global-serializer>
</serializers>
</serialization>
Config config = new Config();
SubZero.useAsGlobalSerializer(config);
HazelcastInstance hz = Hazelcast.newHazelcastInstance(config);
In this mode Hazelcast will use SubZero for selected classes only.
<serialization>
<serializers>
<serializer type-class="some.package.Foo"
class-name="info.jerrinot.subzero.Serializer"/>
<serializer type-class="some.package.Bar"
class-name="info.jerrinot.subzero.Serializer"/>
</serializers>
</serialization>
Config config = new Config();
SubZero.useForClasses(config, Foo.class, Bar.class);
HazelcastInstance hz = Hazelcast.newHazelcastInstance(config);
All cluster members have to use SubZero for the same types and the types have to be declared in the same order. Currently programmatic configuration will result in somewhat higher performance - this is given by a limitation of Hazelcast declarative configuration API. It should be fixed in the next version of Hazelcast.
The project is currently not in the Maven Central Repository. You can use the awesome JitPack service for simple integration into your project.
- Add JitPack repository into your pom.xml:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://www.jitpack.io</url>
</repository>
</repositories>
- Add SubZero as a dependency into your project:
<dependency>
<groupId>com.github.jerrinot.subzero</groupId>
<artifactId>subzero-all</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
- Upload into Maven Central
- More serialization strategies. Currently Kryo is the only supported strategy.
- Better Documentation
This is a community project not affiliated with the Hazelcast project.