Annotation 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
Modifier and TypeOptional ElementDescriptionClass<?>
The message key type when schema type is set toKEY_VALUE
.org.apache.pulsar.common.schema.SchemaType
The default schema type to use for the value schema whenschemaType()
is set toKEY_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 topicDefault 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 schemaTypeDefault 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 themessageKeyType()
andmessageValueSchemaType()
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<?> messageKeyTypeThe message key type when schema type is set toKEY_VALUE
.When the
schemaType()
is not set toKEY_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 messageValueSchemaTypeThe default schema type to use for the value schema whenschemaType()
is set toKEY_VALUE
.When the
schemaType()
is not set toKEY_VALUE
this attribute is ignored and the default schema type must be specified via theschemaType
attribute.- Returns:
- message value schema type when using
KEY_VALUE
schema type
- Default:
- NONE
-