Class PulsarProducerFactory

java.lang.Object
io.micronaut.pulsar.PulsarProducerFactory

@Factory public class PulsarProducerFactory extends Object
Pulsar Producer factory.
Since:
1.0
Author:
Haris Secic
  • Constructor Details

    • PulsarProducerFactory

      public PulsarProducerFactory(TopicResolver topicResolver)
  • Method Details

    • createProducer

      @Prototype public <T> org.apache.pulsar.client.api.Producer<T> createProducer(@Parameter org.apache.pulsar.client.api.PulsarClient pulsarClient, @Parameter io.micronaut.core.annotation.AnnotationValue<PulsarProducer> annotationValue, @Parameter io.micronaut.core.type.Argument<?>[] methodArguments, @Parameter DefaultSchemaHandler simpleSchemaResolver, @Parameter String annotatedMethodName) throws io.micronaut.messaging.exceptions.MessagingClientException
      Simple factory method for producing Pulsar Producer beans.
      Type Parameters:
      T - type of message body for pulsar producer
      Parameters:
      pulsarClient - main Pulsar Client bean
      annotationValue - method annotation to read properties from
      methodArguments - arguments passed to method annotated with @PulsarProducer
      simpleSchemaResolver - schema resolver bean
      annotatedMethodName - method name on which annotation for Pulsar Producer was set
      Returns:
      new Pulsar producer
      Throws:
      io.micronaut.messaging.exceptions.MessagingClientException