Interface StreamSenderMessage
- All Superinterfaces:
AdvancedMessage<OutputStream>
,Message<OutputStream>
StreamSenderMessage
allows for local settlement and disposition management
as well as waiting for remote settlement of a streamed message.-
Method Summary
Modifier and TypeMethodDescriptionabort()
Marks the currently streaming message as being aborted.boolean
aborted()
body
(OutputStreamOptions options) Creates anOutputStream
instance configured with the given options which will write the bytes as the payload of one or more AMQPData
sections based on the provided configuration..complete()
Marks the currently streaming message as being complete.boolean
messageFormat
(int messageFormat) Sets the configured message format value that will be set on the first outgoing AMQPTransfer
frame for the delivery that comprises this streamed message.Creates anOutputStream
instance that writes the bytes given without additional encoding or transformation.sender()
tracker()
Methods inherited from interface org.apache.qpid.protonj2.client.AdvancedMessage
addBodySection, annotations, annotations, applicationProperties, applicationProperties, bodySections, bodySections, clearBodySections, encode, encode, footer, footer, forEachBodySection, header, header, messageFormat, properties, properties
Methods inherited from interface org.apache.qpid.protonj2.client.Message
absoluteExpiryTime, absoluteExpiryTime, annotation, annotation, body, body, contentEncoding, contentEncoding, contentType, contentType, correlationId, correlationId, creationTime, creationTime, deliveryCount, deliveryCount, durable, durable, firstAcquirer, firstAcquirer, footer, footer, forEachAnnotation, forEachFooter, forEachProperty, groupId, groupId, groupSequence, groupSequence, hasAnnotation, hasAnnotations, hasFooter, hasFooters, hasProperties, hasProperty, messageId, messageId, priority, priority, property, property, removeAnnotation, removeFooter, removeProperty, replyTo, replyTo, replyToGroupId, replyToGroupId, subject, subject, timeToLive, timeToLive, to, to, toAdvancedMessage, userId, userId
-
Method Details
-
tracker
StreamTracker tracker()- Returns:
- The
Tracker
assigned to monitor the life-cycle of thisStreamSenderMessage
-
sender
StreamSender sender()- Returns:
- the
Sender
that was used to send the delivery that is being tracked.
-
messageFormat
Sets the configured message format value that will be set on the first outgoing AMQPTransfer
frame for the delivery that comprises this streamed message. This value can only be updated before write operation is attempted and will throw anClientIllegalStateException
if any attempt to alter the value is made following a write.- Specified by:
messageFormat
in interfaceAdvancedMessage<OutputStream>
- Parameters:
messageFormat
- The assigned AMQP message format for this streamed message.- Returns:
- this
StreamSenderMessage
instance. - Throws:
ClientException
- if an error occurs while attempting set the message format.
-
complete
Marks the currently streaming message as being complete.Marking a message as complete finalizes the streaming send operation and causes a final
Transfer
frame to be sent to the remote indicating that the ongoing streaming delivery is done and no more message data will arrive.- Returns:
- this
StreamSenderMessage
instance. - Throws:
ClientException
- if an error occurs while initiating the completion operation.
-
completed
boolean completed()- Returns:
- true if this message has been marked as being complete.
-
abort
Marks the currently streaming message as being aborted. Once aborted no further writes regardless of whether any writes have yet been performed or not.- Returns:
- this
StreamSenderMessage
instance. - Throws:
ClientException
- if an error occurs while initiating the abort operation.
-
aborted
boolean aborted()- Returns:
- true if this
StreamSenderMessage
has been marked as aborted previously.
-
body
Creates anOutputStream
instance configured with the given options which will write the bytes as the payload of one or more AMQPData
sections based on the provided configuration..The returned
OutputStream
can be used to write the payload of an AMQP Message in chunks when the source is not readily available in memory or as part of a larger streams based component. TheData
section based stream allows for control over the AMQP messageSection
values that are sent but does the encoding itself. For stream of message data where the content source already consists of an AMQP encoded message refer to therawOutputStream()
method.- Parameters:
options
- The stream options to use to configure the returnedOutputStream
- Returns:
- a
OutputStream
instance configured using the given options. - Throws:
ClientException
- if an error occurs while creating theOutputStream
.- See Also:
-
rawOutputStream
Creates anOutputStream
instance that writes the bytes given without additional encoding or transformation. Using this stream option disables use of any otherMessage
APIs and the message transfer is completed upon close of thisOutputStream
.The returned
OutputStream
can be used to write the payload of an AMQP Message in chunks when the source is not readily available in memory or as part of a larger streams based component. The source of the bytes written to theOutputStream
should consist of already encoded AMQPMessage
data. For anOutputStream
that performs the encoding of message data refer to thebody(OutputStreamOptions)
method.- Returns:
- an
OutputStream
instance that performs no encoding. - Throws:
ClientException
- if an error occurs while creating theOutputStream
.- See Also:
-