Package io.micronaut.nats.intercept
Class AbstractIntroductionAdvice
java.lang.Object
io.micronaut.nats.intercept.AbstractIntroductionAdvice
- Direct Known Subclasses:
JetStreamIntroductionAdvice
,NatsIntroductionAdvice
Abstract Implementation for nats introduction advices.
- Since:
- 4.0.0
- Author:
- Joachim Grimm
-
Field Summary
Modifier and TypeFieldDescriptionprotected final io.micronaut.context.BeanContext
protected final io.micronaut.core.convert.ConversionService
protected final reactor.core.scheduler.Scheduler
protected final NatsMessageSerDesRegistry
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractIntroductionAdvice
(io.micronaut.context.BeanContext beanContext, ExecutorService executorService, io.micronaut.core.convert.ConversionService conversionService, NatsMessageSerDesRegistry serDesRegistry) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected io.nats.client.Message
buildNatsMessage
(io.micronaut.aop.MethodInvocationContext<Object, Object> context, io.nats.client.impl.Headers headers, io.micronaut.core.type.Argument<?> bodyArgument, NatsMessageSerDes<Object> serDes, Optional<String> subjectOptional) build the nats message to send.protected StaticPublisherState
buildPublisherState
(io.micronaut.inject.ExecutableMethod<?, ?> method) builds the cacheable publisher state.protected static Object
handleResult
(io.micronaut.aop.InterceptedMethod interceptedMethod, reactor.core.publisher.Mono<?> reactive)
-
Field Details
-
beanContext
protected final io.micronaut.context.BeanContext beanContext -
scheduler
protected final reactor.core.scheduler.Scheduler scheduler -
serDesRegistry
-
conversionService
protected final io.micronaut.core.convert.ConversionService conversionService
-
-
Constructor Details
-
AbstractIntroductionAdvice
protected AbstractIntroductionAdvice(io.micronaut.context.BeanContext beanContext, @Named("consumer") ExecutorService executorService, io.micronaut.core.convert.ConversionService conversionService, NatsMessageSerDesRegistry serDesRegistry) Default constructor.- Parameters:
beanContext
- The bean contextexecutorService
- The executor to execute reactive operations onconversionService
- The conversion serviceserDesRegistry
- The serdes registry
-
-
Method Details
-
handleResult
protected static Object handleResult(io.micronaut.aop.InterceptedMethod interceptedMethod, reactor.core.publisher.Mono<?> reactive) -
buildNatsMessage
protected io.nats.client.Message buildNatsMessage(io.micronaut.aop.MethodInvocationContext<Object, Object> context, io.nats.client.impl.Headers headers, io.micronaut.core.type.Argument<?> bodyArgument, NatsMessageSerDes<Object> serDes, Optional<String> subjectOptional) build the nats message to send.- Parameters:
context
- the method invocation contextheaders
- the nats headers from the methodbodyArgument
- the body argumentserDes
- the nats message serdessubjectOptional
- the optional subject- Returns:
- the nats message
-
buildPublisherState
protected StaticPublisherState buildPublisherState(io.micronaut.inject.ExecutableMethod<?, ?> method) builds the cacheable publisher state.- Parameters:
method
- the executable method- Returns:
- the publisher state
-