Class SendRequest.Builder
java.lang.Object
io.awspring.cloud.kinesis.operations.SendRequest.Builder
- Enclosing class:
- SendRequest
Builder for
SendRequest. The stream name, the partition key, and either a payload or a message are
required.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the request.explicitHashKey(@Nullable String explicitHashKey) Set a hash key that overrides the partition key hash when Kinesis picks the shard.Add a custom header, overriding a message header of the same name.Add custom headers, overriding message headers of the same name.Set the message to send, keeping its headers.partitionKey(String partitionKey) Set the partition key that determines the shard.Set the payload to send.sequenceNumberForOrdering(@Nullable String sequenceNumberForOrdering) Set the sequence number of a previous record from the same partition key to keep strict ordering.streamName(String streamName) Set the name of the stream to send the record to.
-
Method Details
-
streamName
Set the name of the stream to send the record to. Required.- Parameters:
streamName- the stream name.- Returns:
- this builder.
-
partitionKey
Set the partition key that determines the shard. Required.- Parameters:
partitionKey- the partition key.- Returns:
- this builder.
-
payload
Set the payload to send. When amessageis also set, this payload replaces the message payload and the message headers are kept.- Parameters:
payload- the payload.- Returns:
- this builder.
-
message
Set the message to send, keeping its headers.- Parameters:
message- the message.- Returns:
- this builder.
-
header
Add a custom header, overriding a message header of the same name.- Parameters:
name- the header name.value- the header value.- Returns:
- this builder.
-
headers
Add custom headers, overriding message headers of the same name.- Parameters:
headers- the headers.- Returns:
- this builder.
-
explicitHashKey
Set a hash key that overrides the partition key hash when Kinesis picks the shard.- Parameters:
explicitHashKey- the explicit hash key, ornullto use the partition key hash.- Returns:
- this builder.
-
sequenceNumberForOrdering
Set the sequence number of a previous record from the same partition key to keep strict ordering. Only applies to single-record sends; batch sends ignore it.- Parameters:
sequenceNumberForOrdering- the sequence number, ornullfor no ordering guarantee.- Returns:
- this builder.
-
build
Build the request.- Returns:
- the request.
- Throws:
IllegalArgumentException- if the stream name or partition key is empty, or neither a payload nor a message is set.
-