Package io.micronaut.nats
Interface ConsumerRegistry
- All Known Implementing Classes:
- NatsConsumerAdvice
public interface ConsumerRegistry
A registry for created Nats consumers.
- Since:
- 3.1.0
- Author:
- jgrimm
- 
Method SummaryModifier and TypeMethodDescription@NonNull io.nats.client.ConsumergetConsumer(@NonNull String id) Returns the subscription by given id.The IDs of the available consumers.@NonNull Set<io.nats.client.Subscription>getConsumerSubscription(@NonNull String id) Returns a managed Consumer's subscriptions.io.nats.client.SubscriptionnewSubscription(@NonNull String connectionName, @NonNull String subject, @Nullable String queue) Create a new subscription from the given connection name.io.nats.client.SubscriptionnewSubscription(@NonNull String subject, @Nullable String queue) Create a new subscription with the default connection.
- 
Method Details- 
getConsumerReturns the subscription by given id.- Parameters:
- id-- StringThe id of the listener
- Returns:
- The consumer
- Throws:
- IllegalArgumentException- If no listener exists for the given ID
 
- 
getConsumerIdsThe 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
 
- 
newSubscriptionio.nats.client.Subscription newSubscription(@NonNull @NonNull String subject, @Nullable @Nullable String queue) Create a new subscription with the default connection.
- 
newSubscriptionio.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.
 
-