Annotation Interface PulsarMessage


@Target(TYPE) @Retention(RUNTIME) @Documented public @interface PulsarMessage
Specifies default topic and schema info for a message class.

When a message class is marked with this annotation, the topic/schema resolution process will use the specified information to determine a topic/schema to use for the message in process.

Author:
Aleksei Arsenev, Chris Bono
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The message key type when schema type is set to KEY_VALUE.
    org.apache.pulsar.common.schema.SchemaType
    The default schema type to use for the value schema when schemaType() is set to KEY_VALUE.
    org.apache.pulsar.common.schema.SchemaType
    Default schema type to use for the annotated message class.
    Default topic for the annotated message class.
  • Element Details

    • topic

      String topic
      Default topic for the annotated message class.
      Returns:
      default topic for the annotated message class or empty string to indicate no default topic is specified
      Default:
      ""
    • schemaType

      org.apache.pulsar.common.schema.SchemaType schemaType
      Default schema type to use for the annotated message class.

      Note that when this is set to KEY_VALUE you must specify the actual key and value information via the messageKeyType() and messageValueSchemaType() attributes, respectively.

      Returns:
      schema type to use for the annotated message class or NONE to indicate no default schema is specified
      Default:
      NONE
    • messageKeyType

      Class<?> messageKeyType
      The message key type when schema type is set to KEY_VALUE.

      When the schemaType() is not set to KEY_VALUE this attribute is ignored.

      Returns:
      message key type when using KEY_VALUE schema type
      Default:
      java.lang.Void.class
    • messageValueSchemaType

      org.apache.pulsar.common.schema.SchemaType messageValueSchemaType
      The default schema type to use for the value schema when schemaType() is set to KEY_VALUE.

      When the schemaType() is not set to KEY_VALUE this attribute is ignored and the default schema type must be specified via the schemaType attribute.

      Returns:
      message value schema type when using KEY_VALUE schema type
      Default:
      NONE