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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidprocess(org.apache.camel.Exchange exchange) com.fasterxml.jackson.core.FormatSchemaresolve(org.apache.camel.Exchange exchange) voidsetContentClass(String contentClass) voidvoidsetValidate(boolean validate)
-
Constructor Details
-
AvroSchemaResolver
public AvroSchemaResolver()
-
-
Method Details
-
getSchema
-
setSchema
-
isValidate
public boolean isValidate() -
setValidate
public void setValidate(boolean validate) -
getContentClass
-
setContentClass
-
process
- Specified by:
processin interfaceorg.apache.camel.Processor- Throws:
Exception
-
resolve
public com.fasterxml.jackson.core.FormatSchema resolve(org.apache.camel.Exchange exchange) - Specified by:
resolvein interfaceorg.apache.camel.component.jackson.SchemaResolver
-