Annotation Interface PulsarReader


@Documented @Retention(RUNTIME) @Target({PARAMETER,FIELD,METHOD}) @Around @Introduction public @interface PulsarReader
Create and inject Pulsar reader into field.
Since:
1.0
Author:
Haris Secic
  • Element Details

    • value

      @AliasFor(member="topic") @AliasFor(annotation=io.micronaut.messaging.annotation.MessageMapping.class,member="value") String value
      Returns:
      topic name to listen to
      See Also:
      Default:
      ""
    • topic

      @AliasFor(member="value") @AliasFor(annotation=io.micronaut.messaging.annotation.MessageMapping.class,member="value") String topic
      Only single topic subscription possible for readers.
      Returns:
      topic name to listen to
      Default:
      ""
    • subscriptionName

      String subscriptionName
      Returns:
      Subscription to connect to.
      Default:
      ""
    • schema

      Defaults to MessageSchema.BYTES as default value for Pulsar Schema is byte[].
      Returns:
      Schema to use with pulsar topic consumer
      Default:
      BYTES
    • keySchema

      MessageSchema keySchema
      If argument annotated with PulsarReader is of KeyValue it's possible to choose different schema for key transfer.
      Returns:
      Schema to use while parsing message key from Pulsar message
      Default:
      BYTES
    • keyEncoding

      org.apache.pulsar.common.schema.KeyValueEncodingType keyEncoding
      If argument annotated with PulsarReader is of KeyValue it's possible to choose where to get the message key from. Otherwise, this attribute is ignored.
      Returns:
      Whether to read key from the message payload or separately.
      Default:
      INLINE
    • readerName

      String readerName
      Returns:
      Reader name.
      Default:
      ""
    • subscribeAsync

      boolean subscribeAsync
      By default, reader should subscribe in non-blocking manner using default CompletableFuture of ConsumerBuilder.subscribeAsync().

      If blocking is set to false, application thread initializing it will block until consumer is successfully subscribed.

      Returns:
      Should the consumer subscribe in async manner or blocking
      Default:
      true
    • startMessageLatest

      boolean startMessageLatest
      Returns:
      Whether to position reader to the newest available message in queue or not.
      Default:
      true
    • readTimeout

      @Min(0L) @jakarta.validation.constraints.Min(0L) int readTimeout
      Ignored on Reader.readNextAsync(). Use -1 for no timeout (default).
      Returns:
      Maximum allowed read time.
      Default:
      0
    • timeoutUnit

      TimeUnit timeoutUnit
      Ignored on Reader.readNextAsync() or if readTimeout() is 0.
      Returns:
      Time unit for readTimeout().
      Default:
      SECONDS