Class MetadataToProperties

java.lang.Object
interlok.rabbitmq.MetadataToProperties
All Implemented Interfaces:
Translator.BasicPropertiesBuilder

@ComponentProfile(summary="Convert metadata into RabbitMQ Headers", since="4.3.0") public class MetadataToProperties extends Object implements Translator.BasicPropertiesBuilder
Build a BasicProperties object from metadata.

Creates a BasicProperties object from metadata. Top level headers such as BasicProperties#getContentType() will be set by the configured Translator.PropertiesBuilderFactory. Subsequently, any metadata that is still available post filter via getHeaderFilter() will be added so they are available via AMQP.BasicProperties.getHeaders().

Things like BasicProperties#getContentEncoding() and BasicProperties#getContentType() are considered informational by Interlok; there is no special treatment if you configure something as 'base64' or 'application/json'

  • Constructor Details

    • MetadataToProperties

      public MetadataToProperties()
  • Method Details

    • build

      public com.rabbitmq.client.AMQP.BasicProperties build(com.adaptris.core.AdaptrisMessage msg)
      Specified by:
      build in interface Translator.BasicPropertiesBuilder
    • withFilter

      public MetadataToProperties withFilter(com.adaptris.core.metadata.MetadataFilter filter)
    • withBuilder

    • getHeaderFilter

      public com.adaptris.core.metadata.MetadataFilter getHeaderFilter()
      Metadata filter that filters metadata so that it is part of com.rabbitmq.client.BasicProperties#getHeaders().

      If not explicitly configured no metadata is published.

    • setHeaderFilter

      public void setHeaderFilter(com.adaptris.core.metadata.MetadataFilter headerFilter)
      Metadata filter that filters metadata so that it is part of com.rabbitmq.client.BasicProperties#getHeaders().

      If not explicitly configured no metadata is published.

    • getBuilderFactory

      public Translator.PropertiesBuilderFactory getBuilderFactory()
      Add specific headers to any created AMQP.BasicProperties object.

      If not explicitly configured, then this will default to a no-op implementation which means that any BasicProperties that is created is determined solely by whether any message metadata should be included as part of the BasicProperties#getHeaders().

      See Also:
    • setBuilderFactory

      public void setBuilderFactory(Translator.PropertiesBuilderFactory builderFactory)
      Add specific headers to any created AMQP.BasicProperties object.

      If not explicitly configured, then this will default to a no-op implementation which means that any BasicProperties that is created is determined solely by whether any message metadata should be included as part of the BasicProperties#getHeaders().

      See Also: