public class DefaultPublisherFactory extends Object implements PublisherFactory
PublisherFactory
implementation.
Creates Publisher
s for topics.
Use CachingPublisherFactory
to cache 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 |
setEnableMessageOrdering(Boolean enableMessageOrdering)
Set whether message ordering should be enabled on the publisher.
|
void |
setEndpoint(String endpoint)
Set the publisher endpoint.
|
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 void setEnableMessageOrdering(Boolean enableMessageOrdering)
enableMessageOrdering
- whether to enable message orderingpublic void setEndpoint(String endpoint)
endpoint
- publisher endpointpublic Publisher createPublisher(String topic)
createPublisher
in interface PublisherFactory
Copyright © 2021. All rights reserved.