Class DefaultSubscriberFactory

java.lang.Object
io.micronaut.gcp.pubsub.bind.DefaultSubscriberFactory
All Implemented Interfaces:
SubscriberFactory, AutoCloseable

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

    • 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 Details

    • 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 Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception