Interface StreamAsync
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
StreamAsyncClient
@Generated(value="OracleSDKGenerator", comments="API Version: 20180418") public interface StreamAsync extends AutoCloseable
Use the Streaming API to produce and consume messages, create streams and stream pools, and manage related items.For more information, see Streaming.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Future<ConsumerCommitResponse>
consumerCommit(ConsumerCommitRequest request, AsyncHandler<ConsumerCommitRequest,ConsumerCommitResponse> handler)
Provides a mechanism to manually commit offsets, if not using commit-on-get consumer semantics.Future<ConsumerHeartbeatResponse>
consumerHeartbeat(ConsumerHeartbeatRequest request, AsyncHandler<ConsumerHeartbeatRequest,ConsumerHeartbeatResponse> handler)
Allows long-running processes to extend the timeout on partitions reserved by a consumer instance.Future<CreateCursorResponse>
createCursor(CreateCursorRequest request, AsyncHandler<CreateCursorRequest,CreateCursorResponse> handler)
Creates a cursor.Future<CreateGroupCursorResponse>
createGroupCursor(CreateGroupCursorRequest request, AsyncHandler<CreateGroupCursorRequest,CreateGroupCursorResponse> handler)
Creates a group-cursor.String
getEndpoint()
Gets the set endpoint for REST call (ex, https://www.example.com)Future<GetGroupResponse>
getGroup(GetGroupRequest request, AsyncHandler<GetGroupRequest,GetGroupResponse> handler)
Returns the current state of a consumer group.Future<GetMessagesResponse>
getMessages(GetMessagesRequest request, AsyncHandler<GetMessagesRequest,GetMessagesResponse> handler)
Returns messages from the specified stream using the specified cursor as the starting point for consumption.Future<PutMessagesResponse>
putMessages(PutMessagesRequest request, AsyncHandler<PutMessagesRequest,PutMessagesResponse> handler)
Emits messages to a stream.void
refreshClient()
Rebuilds the client from scratch.void
setEndpoint(String endpoint)
Sets the endpoint to call (ex, https://www.example.com).Future<UpdateGroupResponse>
updateGroup(UpdateGroupRequest request, AsyncHandler<UpdateGroupRequest,UpdateGroupResponse> handler)
Forcefully changes the current location of a group as a whole; reseting processing location of all consumers to a particular location in the stream.-
Methods inherited from interface java.lang.AutoCloseable
close
-
-
-
-
Method Detail
-
refreshClient
void refreshClient()
Rebuilds the client from scratch.Useful to refresh certificates.
-
setEndpoint
void setEndpoint(String endpoint)
Sets the endpoint to call (ex, https://www.example.com).- Parameters:
endpoint
- The endpoint of the serice.
-
getEndpoint
String getEndpoint()
Gets the set endpoint for REST call (ex, https://www.example.com)
-
consumerCommit
Future<ConsumerCommitResponse> consumerCommit(ConsumerCommitRequest request, AsyncHandler<ConsumerCommitRequest,ConsumerCommitResponse> handler)
Provides a mechanism to manually commit offsets, if not using commit-on-get consumer semantics.This commits offsets assicated with the provided cursor, extends the timeout on each of the affected partitions, and returns an updated cursor.
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
consumerHeartbeat
Future<ConsumerHeartbeatResponse> consumerHeartbeat(ConsumerHeartbeatRequest request, AsyncHandler<ConsumerHeartbeatRequest,ConsumerHeartbeatResponse> handler)
Allows long-running processes to extend the timeout on partitions reserved by a consumer instance.- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
createCursor
Future<CreateCursorResponse> createCursor(CreateCursorRequest request, AsyncHandler<CreateCursorRequest,CreateCursorResponse> handler)
Creates a cursor.Cursors are used to consume a stream, starting from a specific point in the partition and going forward from there. You can create a cursor based on an offset, a time, the trim horizon, or the most recent message in the stream. As the oldest message inside the retention period boundary, using the trim horizon effectively lets you consume all messages in the stream. A cursor based on the most recent message allows consumption of only messages that are added to the stream after you create the cursor. Cursors expire five minutes after you receive them from the service.
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
createGroupCursor
Future<CreateGroupCursorResponse> createGroupCursor(CreateGroupCursorRequest request, AsyncHandler<CreateGroupCursorRequest,CreateGroupCursorResponse> handler)
Creates a group-cursor.- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getGroup
Future<GetGroupResponse> getGroup(GetGroupRequest request, AsyncHandler<GetGroupRequest,GetGroupResponse> handler)
Returns the current state of a consumer group.- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getMessages
Future<GetMessagesResponse> getMessages(GetMessagesRequest request, AsyncHandler<GetMessagesRequest,GetMessagesResponse> handler)
Returns messages from the specified stream using the specified cursor as the starting point for consumption.By default, the number of messages returned is undefined, but the service returns as many as possible. To get messages, you must first obtain a cursor using the
createCursor
operation. In the response, retrieve the value of the ‘opc-next-cursor’ header to pass as a parameter to get the next batch of messages in the stream.- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
putMessages
Future<PutMessagesResponse> putMessages(PutMessagesRequest request, AsyncHandler<PutMessagesRequest,PutMessagesResponse> handler)
Emits messages to a stream.There’s no limit to the number of messages in a request, but the total size of a message or request must be 1 MiB or less. The service calculates the partition ID from the message key and stores messages that share a key on the same partition. If a message does not contain a key or if the key is null, the service generates a message key for you. The partition ID cannot be passed as a parameter.
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
updateGroup
Future<UpdateGroupResponse> updateGroup(UpdateGroupRequest request, AsyncHandler<UpdateGroupRequest,UpdateGroupResponse> handler)
Forcefully changes the current location of a group as a whole; reseting processing location of all consumers to a particular location in the stream.- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
-