Class AvroItemWriter<T>

All Implemented Interfaces:
ItemStream, ItemStreamWriter<T>, ItemWriter<T>

public class AvroItemWriter<T> extends AbstractItemStreamItemWriter<T>
An ItemWriter that serializes data to an WritableResource using Avro.

This does not support restart on failure.

This writer is not thread-safe.

Since:
4.2
Author:
David Turanski, Mahmoud Ben Hassine
  • Constructor Details

    • AvroItemWriter

      public AvroItemWriter(org.springframework.core.io.WritableResource resource, org.springframework.core.io.Resource schema, Class<T> clazz)
      Parameters:
      resource - a WritableResource to which the objects will be serialized.
      schema - a Resource containing the Avro schema.
      clazz - the data type to be serialized.
    • AvroItemWriter

      public AvroItemWriter(org.springframework.core.io.WritableResource resource, Class<T> clazz)
      This constructor will create an ItemWriter that does not embedded Avro schema.
      Parameters:
      resource - a WritableResource to which the objects will be serialized.
      clazz - the data type to be serialized.
  • Method Details