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

    Constructors
    Constructor
    Description
    PubSubBodyBinder(io.micronaut.core.convert.ConversionService conversionService, PubSubMessageSerDesRegistry serDesRegistry)
    Constructs a PubSub body binder instance.
    Deprecated, for removal: This API element is subject to removal in a future version.
    An instance of ConversionService is needed for binding the full range of supported types (including reactive) to PubSub subscriber methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.core.bind.ArgumentBinder.BindingResult<Object>
    bind(io.micronaut.core.convert.ArgumentConversionContext<Object> context, PubSubConsumerState state)
     
    Class<io.micronaut.messaging.annotation.MessageBody>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 of ConversionService 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 service
      serDesRegistry - the SerDe registry
  • Method Details

    • getAnnotationType

      public Class<io.micronaut.messaging.annotation.MessageBody> getAnnotationType()
      Specified by:
      getAnnotationType in interface io.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 interface io.micronaut.core.bind.ArgumentBinder<Object,PubSubConsumerState>