Class PullConsumerRegistry

java.lang.Object
io.micronaut.nats.jetstream.PullConsumerRegistry

@Singleton public class PullConsumerRegistry extends Object
handles new pull subscriptions.
Since:
4.0.0
Author:
Joachim Grimm
  • Constructor Summary

    Constructors
    Constructor
    Description
    PullConsumerRegistry(io.micronaut.context.BeanContext beanContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.nats.client.JetStreamSubscription
    newPullConsumer(@NonNull String subject, @NonNull io.nats.client.PullSubscribeOptions pullSubscribeOptions)
    create a new pull consumer subscription for the default connection.
    io.nats.client.JetStreamSubscription
    newPullConsumer(@NonNull String connectionName, @NonNull String subject, @NonNull io.nats.client.PullSubscribeOptions pullSubscribeOptions)
    create a new pull consumer subscription for the default connection.

    Methods inherited from class java.lang.Object

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

    • PullConsumerRegistry

      public PullConsumerRegistry(io.micronaut.context.BeanContext beanContext)
  • Method Details

    • newPullConsumer

      public io.nats.client.JetStreamSubscription newPullConsumer(@NonNull @NonNull String subject, @NonNull @NonNull io.nats.client.PullSubscribeOptions pullSubscribeOptions) throws io.nats.client.JetStreamApiException, IOException
      create a new pull consumer subscription for the default connection. the subscription is not managed by micronaut and needs to be closed manually
      Parameters:
      subject - String
      pullSubscribeOptions - PullSubscribeOptions
      Returns:
      jetStreamSubcription JetStreamSubscription
      Throws:
      io.nats.client.JetStreamApiException - in case of a jetstream error
      IOException - in case of a connection error
    • newPullConsumer

      public io.nats.client.JetStreamSubscription newPullConsumer(@NonNull @NonNull String connectionName, @NonNull @NonNull String subject, @NonNull @NonNull io.nats.client.PullSubscribeOptions pullSubscribeOptions) throws io.nats.client.JetStreamApiException, IOException
      create a new pull consumer subscription for the default connection. the subscription is not managed by micronaut and needs to be closed manually
      Parameters:
      connectionName - String
      subject - String
      pullSubscribeOptions - PullSubscribeOptions
      Returns:
      jetStreamSubcription JetStreamSubscription
      Throws:
      io.nats.client.JetStreamApiException - in case of a jetstream error
      IOException - in case of a connection error