public interface StreamManagerClient extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
long |
appendMessage(String stream,
byte[] data)
Append a message into the specified message stream.
|
void |
createMessageStream(MessageStreamDefinition definition)
Create a message stream with a given definition.
|
void |
deleteMessageStream(String stream)
Delete a message stream, including the data.
|
MessageStreamInfo |
describeMessageStream(String stream)
Describe a message stream to get metadata including the stream's definition, size, and exporter statuses.
|
List<String> |
listStreams()
List the streams in StreamManager.
|
List<Message> |
readMessages(String stream,
ReadMessagesOptions options)
Read message(s) from a chosen stream with options.
|
void |
updateMessageStream(MessageStreamDefinition definition)
Updates a message stream with a given definition.
|
close
void createMessageStream(MessageStreamDefinition definition) throws StreamManagerException
definition
- the message stream definitionStreamManagerException
- StreamManagerExceptionvoid updateMessageStream(MessageStreamDefinition definition) throws StreamManagerException
definition
- the message stream definitionStreamManagerException
- StreamManagerExceptionvoid deleteMessageStream(String stream) throws StreamManagerException
stream
- stream nameStreamManagerException
- StreamManagerExceptionMessageStreamInfo describeMessageStream(String stream) throws StreamManagerException
stream
- stream nameStreamManagerException
- StreamManagerExceptionlong appendMessage(String stream, byte[] data) throws StreamManagerException
stream
- The name of the stream.data
- The binary payload of the message.StreamManagerException
- StreamManagerExceptionList<Message> readMessages(String stream, ReadMessagesOptions options) throws StreamManagerException
Default options used when reading from the stream: desiredStartSequenceNumber: 0, minMessageCount: 1, maxMessageCount: 1, readTimeoutMillis: 0 // Where 0 here represents that the server will immediately return the messages // or an exception if there were not enough messages available.
If desiredStartSequenceNumber is specified in the options and is less than the current beginning of the stream, returned messages will start at the beginning of the stream and not necessarily the desiredStartSequenceNumber.
stream
- the name of the stream.options
- the options of readMessages() operation.StreamManagerException
- if any error is returned from the serverList<String> listStreams() throws StreamManagerException
StreamManagerException
- if any error is returned from the server.