Class PubSubPublisherState

java.lang.Object
io.micronaut.gcp.pubsub.support.PubSubPublisherState
All Implemented Interfaces:
AutoCloseable

public class PubSubPublisherState extends Object implements AutoCloseable
Stores the context of a PubSubMessage to be pulished. Values of this class comes from parsing of method annotations and hence are cached @see PubSubConsumerAdvice
Since:
2.0.0
Author:
Vinicius Carvalho
  • Constructor Details

    • PubSubPublisherState

      public PubSubPublisherState(PubSubPublisherState.TopicState topicState, Map<String,String> staticMessageAttributes, io.micronaut.core.type.Argument<?> bodyArgument, com.google.cloud.pubsub.v1.PublisherInterface publisher, Optional<io.micronaut.core.type.Argument> orderingArgument)
  • Method Details

    • getPublisher

      public com.google.cloud.pubsub.v1.PublisherInterface getPublisher()
      Returns:
      the cached publisher associated with the method.
    • getTopicState

      public PubSubPublisherState.TopicState getTopicState()
      Returns:
      topicState information
    • getStaticMessageAttributes

      public Map<String,String> getStaticMessageAttributes()
      Returns:
      Message Attributes from Header annotations
    • getBodyArgument

      public io.micronaut.core.type.Argument<?> getBodyArgument()
      Returns:
      the body argument
    • getOrderingArgument

      public Optional<io.micronaut.core.type.Argument> getOrderingArgument()
      Returns:
      Argument annotated with @OrderingKey.
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception