Package io.micronaut.gcp.pubsub.bind
Class DefaultSubscriberFactory
- java.lang.Object
-
- io.micronaut.gcp.pubsub.bind.DefaultSubscriberFactory
-
- All Implemented Interfaces:
SubscriberFactory
,java.lang.AutoCloseable
@Singleton public class DefaultSubscriberFactory extends java.lang.Object implements SubscriberFactory, java.lang.AutoCloseable
Default implementation ofSubscriberFactory
.- 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 anSubscriberInterface
implementation and register the receiver to it.
-
-
-
Method Detail
-
createSubscriber
public com.google.cloud.pubsub.v1.Subscriber createSubscriber(SubscriberFactoryConfig config)
Description copied from interface:SubscriberFactory
Creates anSubscriberInterface
implementation and register the receiver to it. Implementations should also handle start/stop life cycle events.- Specified by:
createSubscriber
in interfaceSubscriberFactory
- Parameters:
config
- Configuration to createSubscriber
instances.- Returns:
- An implementation of SubscriberInterface
-
close
@PreDestroy public void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
-