Class PulsarClientFactory

java.lang.Object
io.micronaut.pulsar.PulsarClientFactory

@Factory @Requires(beans=PulsarClientConfiguration.class) public final class PulsarClientFactory extends Object
Create bean of PulsarClient type which is required by consumers and producers.
Since:
1.0
Author:
Haris Secic
  • Constructor Details

    • PulsarClientFactory

      public PulsarClientFactory()
  • Method Details

    • pulsarClient

      @Singleton public org.apache.pulsar.client.api.PulsarClient pulsarClient(PulsarClientConfiguration pulsarClientConfiguration, io.netty.channel.EventLoopGroup eventLoopGroup) throws io.micronaut.messaging.exceptions.MessagingClientException
      Simple factory method for building main PulsarClient that serves as a connection to Pulsar cluster.
      Parameters:
      pulsarClientConfiguration - Main configuration for building PulsarClient
      eventLoopGroup - netty's event loop group from Micronaut to pass to pulsar
      Returns:
      Instance of PulsarClient
      Throws:
      io.micronaut.messaging.exceptions.MessagingClientException - in case any of the required options are missing or malformed