Package io.micronaut.gcp.pubsub.support
Class PubSubPublisherState
java.lang.Object
io.micronaut.gcp.pubsub.support.PubSubPublisherState
- All Implemented Interfaces:
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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Internal class to represent Topic State. -
Constructor Summary
ConstructorDescriptionPubSubPublisherState
(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 Summary
-
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
- Returns:
- topicState information
-
getStaticMessageAttributes
- Returns:
- Message Attributes from Header annotations
-
getBodyArgument
public io.micronaut.core.type.Argument<?> getBodyArgument()- Returns:
- the body argument
-
getOrderingArgument
- Returns:
- Argument annotated with @
OrderingKey
.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-