Annotation Interface Topic


@Documented @Retention(RUNTIME) @Target(METHOD) @Executable public @interface Topic
Represents a pubsub topic to be used by classes annotated with PubSubClient.
Since:
2.0.0
Author:
Vinicius Carvalho
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Set the name of the topic used to publish messages.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Defines the name of a particular configuration used for a Publisher.
    Defines the Content-Type to be used for message serialization.
    Sets the endpoint that PubSub will use to store messages.
  • Element Details

    • value

      @AliasFor(annotation=io.micronaut.messaging.annotation.MessageMapping.class, member="value") String value
      Set the name of the topic used to publish messages. Valid names are simple names such as "animals" or FQN names such as projects/<project_name>/topics/<topic_name>
      Returns:
      The name of the topic to publish messages to
    • contentType

      String contentType
      Defines the Content-Type to be used for message serialization. Defaults to application/json if not set by the user.
      Returns:
      contentType to use
      Default:
      "application/json"
    • configuration

      String configuration
      Defines the name of a particular configuration used for a Publisher. Configurations can be set via gcp.pubsub.subscriber.*
      Returns:
      configuration name to use for Publisher
      Default:
      ""
    • endpoint

      String endpoint
      Sets the endpoint that PubSub will use to store messages. If not specified the endpoint defined in properties will be used, else PubSub stores messages on the nearest endpoint to the client. This is useful when regulations for data locality such as GDPR are in place.
      Returns:
      the remote endpoint to use
      Default:
      ""