Interface ConsumerRegistry

All Known Implementing Classes:
NatsConsumerAdvice

public interface ConsumerRegistry
A registry for created Nats consumers.
Since:
3.1.0
Author:
jgrimm
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull io.nats.client.Consumer
    getConsumer(@NonNull String id)
    Returns the subscription by given id.
    @NonNull Set<String>
    The IDs of the available consumers.
    @NonNull Set<io.nats.client.Subscription>
    Returns a managed Consumer's subscriptions.
    io.nats.client.Subscription
    newSubscription(@NonNull String connectionName, @NonNull String subject, @Nullable String queue)
    Create a new subscription from the given connection name.
    io.nats.client.Subscription
    newSubscription(@NonNull String subject, @Nullable String queue)
    Create a new subscription with the default connection.
  • Method Details

    • getConsumer

      @NonNull @NonNull io.nats.client.Consumer getConsumer(@NonNull @NonNull String id)
      Returns the subscription by given id.
      Parameters:
      id - String The id of the listener
      Returns:
      The consumer
      Throws:
      IllegalArgumentException - If no listener exists for the given ID
    • getConsumerIds

      @NonNull @NonNull Set<String> getConsumerIds()
      The IDs of the available consumers.
      Returns:
      The consumers
    • getConsumerSubscription

      @NonNull @NonNull Set<io.nats.client.Subscription> getConsumerSubscription(@NonNull @NonNull String id)
      Returns a managed Consumer's subscriptions.
      Parameters:
      id - The id of the producer.
      Returns:
      The consumer subscription
      Throws:
      IllegalArgumentException - If no consumer exists for the given ID
    • newSubscription

      io.nats.client.Subscription newSubscription(@NonNull @NonNull String subject, @Nullable @Nullable String queue)
      Create a new subscription with the default connection.
      Parameters:
      subject - String
      queue - String optional
      Returns:
      subscription Subscription
    • newSubscription

      io.nats.client.Subscription newSubscription(@NonNull @NonNull String connectionName, @NonNull @NonNull String subject, @Nullable @Nullable String queue)
      Create a new subscription from the given connection name.
      Parameters:
      connectionName - String
      subject - String
      queue - String optional
      Returns:
      subscription Subscription