Package org.apache.qpid.protonj2.client
Class StreamSenderOptions
java.lang.Object
org.apache.qpid.protonj2.client.LinkOptions<StreamSenderOptions>
org.apache.qpid.protonj2.client.StreamSenderOptions
- All Implemented Interfaces:
- Cloneable
Options class that controls various aspects of a 
StreamSenderMessage instance and how
 a streamed message transfer is written.- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDefines the default pending write buffering size which is used to control how much outgoing data can be buffered for local writing before the sender has back pressured applied to avoid out of memory conditions due to overly large pending batched writes.static final intDefines the default minimum size that the context write buffer will allocate which drives the interval auto flushing of written data for this context.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates aStreamSenderOptionsinstance with default values for all optionsStreamSenderOptions(StreamSenderOptions options) Create aStreamSenderOptionsinstance that copies all configuration from the givenStreamSenderOptionsinstance.
- 
Method SummaryModifier and TypeMethodDescriptionclone()protected StreamSenderOptionscopyInto(StreamSenderOptions other) Copy all options from thisStreamSenderOptionsinstance into the instance provided.Configures aSupplierwhich provides unique instances ofDeliveryTagGeneratorobjects for anyStreamSendercreated using these options.intpendingWritesBufferSize(int pendingWritesBufferSize) Sets the overall number of bytes the stream sender will allow to be pending for write before applying back pressure to the stream write caller.protected StreamSenderOptionsself()longsendTimeout(long sendTimeout) Configures the timeout used when awaiting a send operation to complete.sendTimeout(long timeout, TimeUnit units) Configures the timeout used when awaiting a send operation to complete.intwriteBufferSize(int writeBufferSize) Sets the overall number of bytes the stream sender will buffer before automatically flushing the currently buffered bytes.Methods inherited from class org.apache.qpid.protonj2.client.LinkOptionsautoSettle, autoSettle, closeTimeout, closeTimeout, closeTimeout, copyInto, deliveryMode, deliveryMode, desiredCapabilities, desiredCapabilities, linkName, linkName, offeredCapabilities, offeredCapabilities, openTimeout, openTimeout, openTimeout, properties, properties, requestTimeout, requestTimeout, requestTimeout, sourceOptions, targetOptions
- 
Field Details- 
DEFAULT_PENDING_WRITES_BUFFER_SIZEpublic static final int DEFAULT_PENDING_WRITES_BUFFER_SIZEDefines the default pending write buffering size which is used to control how much outgoing data can be buffered for local writing before the sender has back pressured applied to avoid out of memory conditions due to overly large pending batched writes.- See Also:
 
- 
MIN_BUFFER_SIZE_LIMITpublic static final int MIN_BUFFER_SIZE_LIMITDefines the default minimum size that the context write buffer will allocate which drives the interval auto flushing of written data for this context.- See Also:
 
 
- 
- 
Constructor Details- 
StreamSenderOptionspublic StreamSenderOptions()Creates aStreamSenderOptionsinstance with default values for all options
- 
StreamSenderOptionsCreate aStreamSenderOptionsinstance that copies all configuration from the givenStreamSenderOptionsinstance.- Parameters:
- options- The options instance to copy all configuration values from.
 
 
- 
- 
Method Details- 
clone
- 
copyIntoCopy all options from thisStreamSenderOptionsinstance into the instance provided.- Parameters:
- other- the target of this copy operation.
- Returns:
- the StreamSenderOptionsinstance that was given.
 
- 
writeBufferSizepublic int writeBufferSize()- Returns:
- the configured context write buffering limit for the associated StreamSender
 
- 
writeBufferSizeSets the overall number of bytes the stream sender will buffer before automatically flushing the currently buffered bytes. By default the stream sender implementation chooses a value for this buffer limit based on the configured frame size limits of the connection.- Parameters:
- writeBufferSize- The number of bytes that can be written before the context performs a flush operation.
- Returns:
- this StreamSenderOptionsinstance.
 
- 
pendingWritesBufferSizepublic int pendingWritesBufferSize()- Returns:
- the configured pending write buffering limit for the associated StreamSender
 
- 
pendingWritesBufferSizeSets the overall number of bytes the stream sender will allow to be pending for write before applying back pressure to the stream write caller. By default the stream sender implementation chooses a value for this pending write limit based on the configured frame size limits of the connection. This is an advanced option and should not be used unless the impact of doing so is understood by the user.- Parameters:
- pendingWritesBufferSize- The number of bytes that can be pending for write before the sender applies back pressure.
- Returns:
- this StreamSenderOptionsinstance.
 
- 
sendTimeoutpublic long sendTimeout()- Returns:
- the timeout used when awaiting a response from the remote when a resource is message send.
 
- 
sendTimeoutConfigures the timeout used when awaiting a send operation to complete. A send will block if the remote has not granted theSenderor theSessioncredit to do so, if the send blocks for longer than this timeout the send call will fail with anClientSendTimedOutExceptionexception to indicate that the send did not complete.- Parameters:
- sendTimeout- Timeout value in milliseconds to wait for a remote response.
- Returns:
- this StreamSenderOptionsinstance.
 
- 
sendTimeoutConfigures the timeout used when awaiting a send operation to complete. A send will block if the remote has not granted theStreamSenderor theSessioncredit to do so, if the send blocks for longer than this timeout the send call will fail with anClientSendTimedOutExceptionexception to indicate that the send did not complete.- Parameters:
- timeout- Timeout value to wait for a remote response.
- units- The- TimeUnitthat defines the timeout span.
- Returns:
- this StreamSenderOptionsinstance.
 
- 
deliveryTagGeneratorSupplierConfigures aSupplierwhich provides unique instances ofDeliveryTagGeneratorobjects for anyStreamSendercreated using these options.The client sender will use a default DeliveryTagGeneratorunder normal circumstances and the user is not required to configure aSupplier. In some cases where the user is communicating with a system that requires a specific format of delivery tag this option allows use of a custom generator. The caller is responsible for providing a supplier that will create a unique instance of a tag generator as they are not meant to be shared amongst senders. Once a sender has been created the tag generator it uses cannot be changed so future calls to this method will not affect previously createdStreamSenderinstances.- Parameters:
- supplier- The- Supplierof- DeliveryTagGeneratorinstances.
- Returns:
- the StreamSenderOptionsinstance that was given.
 
- 
deliveryTagGeneratorSupplier- Returns:
- the configured delivery tag Supplieror null if none was set.
 
- 
self- Specified by:
- selfin class- LinkOptions<StreamSenderOptions>
- Returns:
- the true derived type instance for use in this class.
 
 
-