Class AdaptedReactivePulsarClientFactory

java.lang.Object
org.apache.pulsar.reactive.client.adapter.AdaptedReactivePulsarClientFactory

public final class AdaptedReactivePulsarClientFactory extends Object
Class to create ReactivePulsarClient and ReactiveMessageSenderCache. instances.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.pulsar.reactive.client.api.ReactivePulsarClient
    create(Supplier<org.apache.pulsar.client.api.PulsarClient> pulsarClientSupplier)
    Creates a ReactivePulsarClient which will lazily call the provided supplier to get an instance of a Pulsar Client when needed.
    static org.apache.pulsar.reactive.client.api.ReactivePulsarClient
    create(org.apache.pulsar.client.api.PulsarClient pulsarClient)
    Creates a ReactivePulsarClient by wrapping an existing PulsarClient instance.
    static org.apache.pulsar.reactive.client.api.ReactiveMessageSenderCache
    Creates a ReactiveMessageSenderCache.
    static org.apache.pulsar.reactive.client.api.ReactiveMessageSenderCache
    createCache(ProducerCacheProvider producerCacheProvider)
    Creates a ReactiveMessageSenderCache adapting the provided ProducerCacheProvider.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static org.apache.pulsar.reactive.client.api.ReactivePulsarClient create(org.apache.pulsar.client.api.PulsarClient pulsarClient)
      Creates a ReactivePulsarClient by wrapping an existing PulsarClient instance.
      Parameters:
      pulsarClient - the Pulsar Client instance to use
      Returns:
      a ReactivePulsarClient instance
    • create

      public static org.apache.pulsar.reactive.client.api.ReactivePulsarClient create(Supplier<org.apache.pulsar.client.api.PulsarClient> pulsarClientSupplier)
      Creates a ReactivePulsarClient which will lazily call the provided supplier to get an instance of a Pulsar Client when needed.
      Parameters:
      pulsarClientSupplier - the supplier to use for getting a Pulsar Client instance
      Returns:
      a ReactivePulsarClient instance
    • createCache

      public static org.apache.pulsar.reactive.client.api.ReactiveMessageSenderCache createCache(ProducerCacheProvider producerCacheProvider)
      Creates a ReactiveMessageSenderCache adapting the provided ProducerCacheProvider.
      Parameters:
      producerCacheProvider - a ProducerCacheProvider instance
      Returns:
      a ReactiveMessageSenderCache instance
    • createCache

      public static org.apache.pulsar.reactive.client.api.ReactiveMessageSenderCache createCache()
      Creates a ReactiveMessageSenderCache. If a ProducerCacheProviderFactory can be loaded by the ServiceLoader, it is used to supply a ProducerCacheProvider from which the ReactiveMessageSenderCache is adapted. Otherwise, the ReactiveMessageSenderCache is adapted from a new ConcurrentHashMapProducerCacheProvider instance.
      Returns:
      a ReactiveMessageSenderCache instance