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.booleanaborted()body(OutputStreamOptions options) Creates anOutputStreaminstance configured with the given options which will write the bytes as the payload of one or more AMQPDatasections based on the provided configuration..complete()Marks the currently streaming message as being complete.booleanmessageFormat(int messageFormat) Sets the configured message format value that will be set on the first outgoing AMQPTransferframe for the delivery that comprises this streamed message.Creates anOutputStreaminstance 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, propertiesMethods 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
Trackerassigned to monitor the life-cycle of thisStreamSenderMessage
-
sender
StreamSender sender()- Returns:
- the
Senderthat 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 AMQPTransferframe for the delivery that comprises this streamed message. This value can only be updated before write operation is attempted and will throw anClientIllegalStateExceptionif any attempt to alter the value is made following a write.- Specified by:
messageFormatin interfaceAdvancedMessage<OutputStream>- Parameters:
messageFormat- The assigned AMQP message format for this streamed message.- Returns:
- this
StreamSenderMessageinstance. - 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
Transferframe to be sent to the remote indicating that the ongoing streaming delivery is done and no more message data will arrive.- Returns:
- this
StreamSenderMessageinstance. - 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
StreamSenderMessageinstance. - Throws:
ClientException- if an error occurs while initiating the abort operation.
-
aborted
boolean aborted()- Returns:
- true if this
StreamSenderMessagehas been marked as aborted previously.
-
body
Creates anOutputStreaminstance configured with the given options which will write the bytes as the payload of one or more AMQPDatasections based on the provided configuration..The returned
OutputStreamcan 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. TheDatasection based stream allows for control over the AMQP messageSectionvalues 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
OutputStreaminstance configured using the given options. - Throws:
ClientException- if an error occurs while creating theOutputStream.- See Also:
-
rawOutputStream
Creates anOutputStreaminstance that writes the bytes given without additional encoding or transformation. Using this stream option disables use of any otherMessageAPIs and the message transfer is completed upon close of thisOutputStream.The returned
OutputStreamcan 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 theOutputStreamshould consist of already encoded AMQPMessagedata. For anOutputStreamthat performs the encoding of message data refer to thebody(OutputStreamOptions)method.- Returns:
- an
OutputStreaminstance that performs no encoding. - Throws:
ClientException- if an error occurs while creating theOutputStream.- See Also:
-