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.
An example such a custom codec class (JodaTypeCodec):