Package io.micronaut.gcp.pubsub.support
Class DefaultPublisherFactory
- java.lang.Object
-
- io.micronaut.gcp.pubsub.support.DefaultPublisherFactory
-
- All Implemented Interfaces:
PublisherFactory
@Singleton public class DefaultPublisherFactory extends java.lang.Object implements PublisherFactory
The defaultPublisherFactory
implementation.Creates
Publisher
s for topics once, caches and reuses them.Original source at : https://github.com/spring-cloud/spring-cloud-gcp/blob/master/spring-cloud-gcp-pubsub/src/main/java/org/springframework/cloud/gcp/pubsub/support/DefaultPublisherFactory.java
- Since:
- 2.0.0
- Author:
- João André Martins, Chengyuan Zhao, Vinicius Carvalho
-
-
Constructor Summary
Constructors Constructor Description DefaultPublisherFactory(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 com.google.cloud.pubsub.v1.Publisher
createPublisher(PublisherFactoryConfig config)
Creates a publisher for a given topic.
-
-
-
Method Detail
-
createPublisher
public com.google.cloud.pubsub.v1.Publisher createPublisher(@Nonnull PublisherFactoryConfig config)
Creates a publisher for a given topic.- Specified by:
createPublisher
in interfacePublisherFactory
- Parameters:
config
-PublisherFactoryConfig
object containing all required properties.- Returns:
- An instance of
Publisher
configured using the config and environment properties from `gcp.pubsub.publisher.>config_name<`
-
-