@Singleton public class DefaultPublisherFactory extends java.lang.Object implements PublisherFactory
PublisherFactory
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
Constructor and Description |
---|
DefaultPublisherFactory(com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider,
com.google.api.gax.core.CredentialsProvider credentialsProvider,
io.micronaut.context.BeanContext beanContext) |
Modifier and Type | Method and Description |
---|---|
com.google.cloud.pubsub.v1.Publisher |
createPublisher(PublisherFactoryConfig config)
Creates and caches a publisher for a given topic.
|
public DefaultPublisherFactory(com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider, com.google.api.gax.core.CredentialsProvider credentialsProvider, io.micronaut.context.BeanContext beanContext)
public com.google.cloud.pubsub.v1.Publisher createPublisher(@Nonnull PublisherFactoryConfig config)
createPublisher
in interface PublisherFactory
config
- PublisherFactoryConfig
object containing all required properties.Publisher
configured using the config and environment properties from `gcp.pubsub.publisher.>config_name<`