-
Enhancement
-
Resolution: Done
-
Major
-
1.3.0.Beta7
-
None
org.jberet.support.io.CassandraItemReader and org.jberet.support.io.CassandraItemWriter currently support a custom codec registry. But oftentimes it may be overkill to replace the built-in codec registry. In most cases, users just need to add a couple of custom codec but still using the built-in codec.
If the Cassandra session is injected into item reader, writer or batchlet, then the application has full control of how to configure the cluster and creating session, including registering custom codec. And this should be the preferred approach as opposed to relying on batch properties for adding custom codec.
Additionally, since an injected Session is usually shared resource between various parts of the application, or even among multiple applications, any custom codec configured with batch properties on CassandraItemReader, CassandraItemWriter or CassandraBatchlet should not export the mutation outside the batch artifact.
Resources:
https://docs.datastax.com/en/developer/java-driver/3.2/manual/custom_codecs/
An example such a custom codec class (JodaTypeCodec):
https://github.com/jberet/jsr352/blob/master/jberet-support/src/test/java/org/jberet/support/io/CassandraReaderWriterTest.java#L511
- relates to
-
JBERET-374 Implement Cassandra Batch Item Reader and Writer
- Resolved
-
JBERET-379 Implement Cassandra Batchlet to Run Cassandra CQL
- Resolved
-
JBERET-385 Create a test app for Cassandra batchlet, item reader and item writer
- Resolved