Class ProtobufSchemaResolver

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

public class ProtobufSchemaResolver extends Object implements org.apache.camel.component.jackson.SchemaResolver, org.apache.camel.Processor
Schema resolver able to read Protobuf schema from given exchange being processed. First attempt is to retrieve the Protobuf schema reference from exchange properties. Second approach is to convert a given Json schema to a proper Protobuf schema also reading from the exchange properties. Last approach it to load the Protobuf 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

    • ProtobufSchemaResolver

      public ProtobufSchemaResolver()
  • Method Details

    • getSchema

      public String getSchema()
    • setSchema

      public void setSchema(String schema)
    • 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