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 Object
Factory class to create default settings for PubSub Publisher and subscriber beans.
Since:
2.0.0
Author:
Vinicius Carvalho
  • Constructor Details

  • Method Details

    • 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 TransportChannelProvider that 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 default CredentialsProvider, allows users to override it and provide their own implementation.
      Parameters:
      credentials - default credentials, if not overridden by user should be provided by GoogleCredentialsFactory
      Returns:
      A FixedCredentialsProvider holding the given credentials.
    • noCredentialsProvider

      @Singleton @Named("pubsub") @Requires(property="pubsub.emulator.host") public com.google.api.gax.core.CredentialsProvider noCredentialsProvider()
      Returns a NoCredentialsProvider. Useful for when running with an emulator instead of targeting GCP Pub/Sub service.
      Returns:
      A NoCredentialsProvider with no credentials.