public interface MessageConsumer
extends java.lang.AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Unsubscribe the underlying subject.
|
ConsumerInfo |
getCachedConsumerInfo()
Gets information about the consumer behind this subscription.
|
ConsumerInfo |
getConsumerInfo()
Gets information about the consumer behind this subscription.
|
java.lang.String |
getConsumerName()
Gets the consumer name associated with the subscription.
|
boolean |
isFinished()
Finish indicates all messages have been received from the server.
|
boolean |
isStopped()
Stopped indicates whether consuming has been stopped.
|
void |
stop()
Use
close() to unsubscribe. |
java.lang.String getConsumerName()
ConsumerInfo getConsumerInfo() throws java.io.IOException, JetStreamApiException
java.io.IOException
- covers various communication issues with the NATS
server such as timeout or interruptionJetStreamApiException
- the request had an error related to the dataConsumerInfo getCachedConsumerInfo()
void stop()
close()
to unsubscribe. Stop will not unsubcribe or clean up resources.
The consumer will finish all pull request already in progress, but will not start any new ones.void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception
boolean isStopped()
boolean isFinished()