public class DefaultPublisherFactory extends Object implements PublisherFactory
PublisherFactory implementation.
Creates Publishers for topics once, caches and reuses them.
| Constructor and Description |
|---|
DefaultPublisherFactory(GcpProjectIdProvider projectIdProvider)
Create
DefaultPublisherFactory instance based on the provided GcpProjectIdProvider. |
| Modifier and Type | Method and Description |
|---|---|
Publisher |
createPublisher(String topic) |
void |
setBatchingSettings(com.google.api.gax.batching.BatchingSettings batchingSettings)
Set the API call batching configuration.
|
void |
setChannelProvider(com.google.api.gax.rpc.TransportChannelProvider channelProvider)
Set the provider for the channel to be used by the publisher.
|
void |
setCredentialsProvider(com.google.api.gax.core.CredentialsProvider credentialsProvider)
Set the provider for the GCP credentials to be used by the publisher on every API calls it makes.
|
void |
setExecutorProvider(com.google.api.gax.core.ExecutorProvider executorProvider)
Set the provider for the executor that will be used by the publisher.
|
void |
setHeaderProvider(com.google.api.gax.rpc.HeaderProvider headerProvider)
Set the provider for the HTTP headers to be used in the Pub/Sub REST API requests.
|
void |
setRetrySettings(com.google.api.gax.retrying.RetrySettings retrySettings)
Set the API call retry configuration.
|
public DefaultPublisherFactory(GcpProjectIdProvider projectIdProvider)
DefaultPublisherFactory instance based on the provided GcpProjectIdProvider.
The GcpProjectIdProvider must not be null, neither provide an empty projectId.
projectIdProvider - provides the default GCP project ID for selecting the topicpublic void setExecutorProvider(com.google.api.gax.core.ExecutorProvider executorProvider)
executorProvider - the executor provider to setpublic void setChannelProvider(com.google.api.gax.rpc.TransportChannelProvider channelProvider)
channelProvider - the channel provider to setpublic void setCredentialsProvider(com.google.api.gax.core.CredentialsProvider credentialsProvider)
credentialsProvider - the credentials provider to setpublic void setHeaderProvider(com.google.api.gax.rpc.HeaderProvider headerProvider)
headerProvider - the header provider to setpublic void setRetrySettings(com.google.api.gax.retrying.RetrySettings retrySettings)
retrySettings - the retry settings to setpublic void setBatchingSettings(com.google.api.gax.batching.BatchingSettings batchingSettings)
batchingSettings - the batching settings to setpublic Publisher createPublisher(String topic)
createPublisher in interface PublisherFactoryCopyright © 2020 Pivotal Software, Inc.. All rights reserved.