Class PubSubPublisherState

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class PubSubPublisherState
    extends java.lang.Object
    implements java.lang.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 Detail

      • PubSubPublisherState

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

      • getPublisher

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

        public java.util.Map<java.lang.String,​java.lang.String> getStaticMessageAttributes()
        Returns:
        Message Attributes from Header annotations
      • getBodyArgument

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

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

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