Class DefaultSubscriberFactory

  • All Implemented Interfaces:
    SubscriberFactory, java.lang.AutoCloseable

    @Singleton
    public class DefaultSubscriberFactory
    extends java.lang.Object
    implements SubscriberFactory, java.lang.AutoCloseable
    Default implementation of SubscriberFactory.
    Since:
    2.0.0
    Author:
    Vinicius Carvalho
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultSubscriberFactory​(com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider, com.google.api.gax.core.CredentialsProvider credentialsProvider, io.micronaut.context.BeanContext beanContext)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      com.google.cloud.pubsub.v1.Subscriber createSubscriber​(SubscriberFactoryConfig config)
      Creates an SubscriberInterface implementation and register the receiver to it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultSubscriberFactory

        public DefaultSubscriberFactory​(@Named("pubsub")
                                        com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider,
                                        @Named("pubsub")
                                        com.google.api.gax.core.CredentialsProvider credentialsProvider,
                                        io.micronaut.context.BeanContext beanContext)
    • Method Detail

      • createSubscriber

        public com.google.cloud.pubsub.v1.Subscriber createSubscriber​(SubscriberFactoryConfig config)
        Description copied from interface: SubscriberFactory
        Creates an SubscriberInterface implementation and register the receiver to it. Implementations should also handle start/stop life cycle events.
        Specified by:
        createSubscriber in interface SubscriberFactory
        Parameters:
        config - Configuration to create Subscriber instances.
        Returns:
        An implementation of SubscriberInterface
      • close

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