Package io.micronaut.nats.jetstream
Class PullConsumerRegistry
java.lang.Object
io.micronaut.nats.jetstream.PullConsumerRegistry
handles new pull subscriptions.
- Since:
- 4.0.0
- Author:
- Joachim Grimm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.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.
-
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 errorIOException
- 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 errorIOException
- in case of a connection error
-