Package io.micronaut.gcp.pubsub.support
Class PubSubConfigurationFactory
- java.lang.Object
-
- io.micronaut.gcp.pubsub.support.PubSubConfigurationFactory
-
@Factory @Requires(classes=com.google.cloud.pubsub.v1.Publisher.class) public class PubSubConfigurationFactory extends java.lang.ObjectFactory class to create default settings for PubSub Publisher and subscriber beans.- Since:
- 2.0.0
- Author:
- Vinicius Carvalho
-
-
Constructor Summary
Constructors Constructor Description PubSubConfigurationFactory(PubSubConfigurationProperties pubSubConfigurationProperties, GoogleCloudConfiguration googleCloudConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.api.gax.core.CredentialsProvidercredentialsProvider(com.google.auth.oauth2.GoogleCredentials credentials)Returns a defaultCredentialsProvider, allows users to override it and provide their own implementation.com.google.api.gax.rpc.TransportChannelProviderlocalChannelProvider(io.micronaut.context.env.Environment environment)com.google.api.gax.core.CredentialsProvidernoCredentialsProvider()Returns aNoCredentialsProvider.com.google.api.gax.core.ExecutorProviderpublisherExecutorProvider()com.google.api.gax.rpc.TransportChannelProvidertransportChannelProvider()
-
-
-
Constructor Detail
-
PubSubConfigurationFactory
public PubSubConfigurationFactory(PubSubConfigurationProperties pubSubConfigurationProperties, GoogleCloudConfiguration googleCloudConfiguration)
-
-
Method Detail
-
publisherExecutorProvider
@Singleton public com.google.api.gax.core.ExecutorProvider publisherExecutorProvider()
- Returns:
- default
ExecutorProvider
-
transportChannelProvider
@Singleton @Named("pubsub") @Requires(missingProperty="pubsub.emulator.host") public com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider()- Returns:
- default
TransportChannelProviderTransportChannelProvider
-
localChannelProvider
@Singleton @Named("pubsub") @Requires(property="pubsub.emulator.host") public com.google.api.gax.rpc.TransportChannelProvider localChannelProvider(io.micronaut.context.env.Environment environment)- Parameters:
environment- - Micronaut Environment to fetch PUBSUB_EMULATOR_HOST value- Returns:
- a
TransportChannelProviderthat targets the PUBSUB_EMULATOR_HOST
-
credentialsProvider
@Singleton @Named("pubsub") @Requires(missingProperty="pubsub.emulator.host") public com.google.api.gax.core.CredentialsProvider credentialsProvider(com.google.auth.oauth2.GoogleCredentials credentials)Returns a defaultCredentialsProvider, allows users to override it and provide their own implementation.- Parameters:
credentials- default credentials, if not overridden by user should be provided byGoogleCredentialsFactory- Returns:
- A
FixedCredentialsProviderholding the given credentials.
-
noCredentialsProvider
@Singleton @Named("pubsub") @Requires(property="pubsub.emulator.host") public com.google.api.gax.core.CredentialsProvider noCredentialsProvider()Returns aNoCredentialsProvider. Useful for when running with an emulator instead of targeting GCP Pub/Sub service.- Returns:
- A
NoCredentialsProviderwith no credentials.
-
-