Package io.micronaut.gcp.pubsub.bind
Class PubSubBodyBinder
java.lang.Object
io.micronaut.gcp.pubsub.bind.PubSubBodyBinder
- All Implemented Interfaces:
io.micronaut.core.bind.annotation.AnnotatedArgumentBinder<io.micronaut.messaging.annotation.MessageBody,
,Object, PubSubConsumerState> io.micronaut.core.bind.ArgumentBinder<Object,
,PubSubConsumerState> PubSubAnnotatedArgumentBinder<io.micronaut.messaging.annotation.MessageBody>
,PubSubArgumentBinder<Object>
@Singleton
public class PubSubBodyBinder
extends Object
implements PubSubAnnotatedArgumentBinder<io.micronaut.messaging.annotation.MessageBody>
Binds arguments annotated with
MessageBody
and uses the appropriate
PubSubMessageSerDes
to deserialize the contents of the PubSubMessage data.- Since:
- 2.0.0
- Author:
- Vinicius Carvalho
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.core.bind.ArgumentBinder
io.micronaut.core.bind.ArgumentBinder.BindingResult<T extends Object>
-
Constructor Summary
ConstructorDescriptionPubSubBodyBinder
(io.micronaut.core.convert.ConversionService conversionService, PubSubMessageSerDesRegistry serDesRegistry) Constructs a PubSub body binder instance.PubSubBodyBinder
(PubSubMessageSerDesRegistry serDesRegistry) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.core.bind.ArgumentBinder.BindingResult<Object>
bind
(io.micronaut.core.convert.ArgumentConversionContext<Object> context, PubSubConsumerState state) Class<io.micronaut.messaging.annotation.MessageBody>
-
Constructor Details
-
PubSubBodyBinder
@Deprecated(since="5.2.0", forRemoval=true) public PubSubBodyBinder(PubSubMessageSerDesRegistry serDesRegistry) Deprecated, for removal: This API element is subject to removal in a future version.An instance ofConversionService
is needed for binding the full range of supported types (including reactive) to PubSub subscriber methods.PubSubBodyBinder(ConversionService, PubSubMessageSerDesRegistry)
should be used instead.Constructs a PubSub body binder instance.- Parameters:
serDesRegistry
- the SerDe registry
-
PubSubBodyBinder
@Inject public PubSubBodyBinder(io.micronaut.core.convert.ConversionService conversionService, PubSubMessageSerDesRegistry serDesRegistry) Constructs a PubSub body binder instance.- Parameters:
conversionService
- the conversion serviceserDesRegistry
- the SerDe registry
-
-
Method Details
-
getAnnotationType
- Specified by:
getAnnotationType
in interfaceio.micronaut.core.bind.annotation.AnnotatedArgumentBinder<io.micronaut.messaging.annotation.MessageBody,
Object, PubSubConsumerState>
-
bind
public io.micronaut.core.bind.ArgumentBinder.BindingResult<Object> bind(io.micronaut.core.convert.ArgumentConversionContext<Object> context, PubSubConsumerState state) - Specified by:
bind
in interfaceio.micronaut.core.bind.ArgumentBinder<Object,
PubSubConsumerState>
-
ConversionService
is needed for binding the full range of supported types (including reactive) to PubSub subscriber methods.