Annotation Interface Consume.FromTopic

Enclosing class:
Consume

@Target(TYPE) @Retention(RUNTIME) @Documented public static @interface Consume.FromTopic
Annotation for consuming messages from a topic (i.e PubSub or Kafka topic).

The underlying method must be declared to receive one parameter for the received messages. Use one method with the common message type as parameter, or several methods with different parameter types corresponding to different messages types.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Assign the name of the topic to consume the stream from.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Assign the consumer group name to be used on the broker.
    boolean
    This option is only available for classes.
  • Element Details

    • value

      String value
      Assign the name of the topic to consume the stream from.
    • consumerGroup

      String consumerGroup
      Assign the consumer group name to be used on the broker.
      Default:
      ""
    • ignoreUnknown

      boolean ignoreUnknown
      This option is only available for classes. Using it in a method has no effect.

      When there is no method in the class whose input type matches the event type:

      • if ignoreUnknown is true the event is discarded
      • if false, an Exception is raised
      Default:
      false