Class SimpleToAvroTransformer

All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, ExpressionCapable, GenericTransformer<org.springframework.messaging.Message<?>,org.springframework.messaging.Message<?>>, NamedComponent, Transformer

public class SimpleToAvroTransformer extends AbstractTransformer
An Apache Avro transformer for generated SpecificRecord objects.
Since:
5.2
  • Constructor Details

    • SimpleToAvroTransformer

      public SimpleToAvroTransformer()
  • Method Details

    • typeExpression

      public SimpleToAvroTransformer typeExpression(org.springframework.expression.Expression expression)
      Set the expression to evaluate against the message to determine the value for the AvroHeaders.TYPE header.
      Parameters:
      expression - the expression.
      Returns:
      the transformer
    • typeExpression

      public SimpleToAvroTransformer typeExpression(String expression)
      Set the expression to evaluate against the message to determine the value for the AvroHeaders.TYPE header.
      Parameters:
      expression - the expression.
      Returns:
      the transformer
    • setTypeExpression

      public void setTypeExpression(org.springframework.expression.Expression expression)
      Set the expression to evaluate against the message to determine the value for the AvroHeaders.TYPE header.
      Parameters:
      expression - the expression.
    • setTypeExpressionString

      public void setTypeExpressionString(String expression)
      Set the expression to evaluate against the message to determine the value for the AvroHeaders.TYPE header.
      Parameters:
      expression - the expression.
    • onInit

      protected void onInit()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this for initialization logic.
      Overrides:
      onInit in class IntegrationObjectSupport
    • doTransform

      protected Object doTransform(org.springframework.messaging.Message<?> message)
      Description copied from class: AbstractTransformer
      Subclasses must implement this method to provide the transformation logic. If the return value is itself a Message, it will be used as the result. Otherwise, any non-null return value will be used as the payload of the result Message.
      Specified by:
      doTransform in class AbstractTransformer
      Parameters:
      message - The message.
      Returns:
      The result of the transformation.