Class AvroSchemaResolver

java.lang.Object
org.apache.camel.component.jackson.avro.transform.AvroSchemaResolver
All Implemented Interfaces:
org.apache.camel.component.jackson.SchemaResolver, org.apache.camel.Processor

public class AvroSchemaResolver extends Object implements org.apache.camel.component.jackson.SchemaResolver, org.apache.camel.Processor
Schema resolver able to read Avro schema from given exchange being processed. First attempt is to retrieve the Avro schema reference from exchange properties. Second approach is to convert a given Json schema to a proper Avro schema also reading from the exchange properties. Last approach it to load the Avro schema as a classpath resource. The following resource path is used to resolve the schema classpath:schemas/asvc/<T>.asvc where T represents the content class name of the exchange body. The content class information is either set as an explicit exchange property or it gets resolved from exchange body type information.
  • Constructor Details

    • AvroSchemaResolver

      public AvroSchemaResolver()
  • Method Details

    • getSchema

      public String getSchema()
    • setSchema

      public void setSchema(String schema)
    • isValidate

      public boolean isValidate()
    • setValidate

      public void setValidate(boolean validate)
    • getContentClass

      public String getContentClass()
    • setContentClass

      public void setContentClass(String contentClass)
    • process

      public void process(org.apache.camel.Exchange exchange) throws Exception
      Specified by:
      process in interface org.apache.camel.Processor
      Throws:
      Exception
    • resolve

      public com.fasterxml.jackson.core.FormatSchema resolve(org.apache.camel.Exchange exchange)
      Specified by:
      resolve in interface org.apache.camel.component.jackson.SchemaResolver