Package io.micronaut.gcp.pubsub.bind
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 Summary
ConstructorDescriptionDefaultSubscriberFactory
(com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider, com.google.api.gax.core.CredentialsProvider credentialsProvider, io.micronaut.context.BeanContext beanContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
com.google.cloud.pubsub.v1.Subscriber
Creates anSubscriberInterface
implementation and register the receiver to it.
-
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
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
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-