Class StreamReceiverOptions


  • public class StreamReceiverOptions
    extends ReceiverOptions
    Options class that controls various aspects of a StreamReceiver instance and how a streamed message transfer is written.
    • Field Detail

      • DEFAULT_READ_BUFFER_SIZE

        public static final int DEFAULT_READ_BUFFER_SIZE
        Defines the default read buffering size which is used to control how much incoming data can be buffered before the remote has back pressured applied to avoid out of memory conditions.
        See Also:
        Constant Field Values
    • Constructor Detail

      • StreamReceiverOptions

        public StreamReceiverOptions()
        Creates a StreamReceiverOptions instance with default values for all options
    • Method Detail

      • readBufferSize

        public int readBufferSize()
        Returns:
        the configured session capacity for the parent session of the StreamReceiver.
      • readBufferSize

        public StreamReceiverOptions readBufferSize​(int readBufferSize)
        Sets the incoming buffer capacity (in bytes) that the StreamReceiver.

        When the remote peer is sending incoming data for a StreamReceiverMessage the amount that is stored in memory before back pressure is applied to the remote is controlled by this option. If the user does not read incoming data as it arrives this limit can prevent out of memory errors that might otherwise arise as the remote attempts to immediately send all contents of very large message payloads.

        Parameters:
        readBufferSize - The number of bytes that the StreamReceiver will buffer for a given StreamReceiverMessage.
        Returns:
        this StreamReceiverOptions instance.
      • autoAccept

        public StreamReceiverOptions autoAccept​(boolean autoAccept)
        Description copied from class: ReceiverOptions
        Controls if the created Receiver will automatically accept the deliveries that have been received by the application (default is true).
        Overrides:
        autoAccept in class ReceiverOptions
        Parameters:
        autoAccept - The value to assign for auto delivery acceptance.
        Returns:
        this ReceiverOptions instance.
      • autoSettle

        public StreamReceiverOptions autoSettle​(boolean autoSettle)
        Description copied from class: ReceiverOptions
        Controls if the created Receiver will automatically settle the deliveries that have been received by the application (default is true).
        Overrides:
        autoSettle in class ReceiverOptions
        Parameters:
        autoSettle - The value to assign for auto delivery settlement.
        Returns:
        this ReceiverOptions instance.
      • creditWindow

        public StreamReceiverOptions creditWindow​(int creditWindow)
        Description copied from class: ReceiverOptions
        A credit window value that will be used to maintain an window of credit for Receiver instances that are created. The Receiver will allow up to the credit window amount of incoming deliveries to be queued and as they are read from the Receiver the window will be extended to maintain a consistent backlog of deliveries. The default is to configure a credit window of 10.

        To disable credit windowing and allow the client application to control the credit on the Receiver link the credit window value should be set to zero.

        Overrides:
        creditWindow in class ReceiverOptions
        Parameters:
        creditWindow - The assigned credit window value to use.
        Returns:
        this ReceiverOptions instance.
      • closeTimeout

        public StreamReceiverOptions closeTimeout​(long timeout,
                                                  java.util.concurrent.TimeUnit units)
        Description copied from class: ReceiverOptions
        Configures the timeout used when awaiting a response from the remote that a request to close the Receiver link.
        Overrides:
        closeTimeout in class ReceiverOptions
        Parameters:
        timeout - Timeout value to wait for a remote response.
        units - The TimeUnit that defines the timeout span.
        Returns:
        this ReceiverOptions instance.
      • openTimeout

        public StreamReceiverOptions openTimeout​(long timeout,
                                                 java.util.concurrent.TimeUnit units)
        Description copied from class: ReceiverOptions
        Configures the timeout used when awaiting a response from the remote that a request to open a Receiver has been honored.
        Overrides:
        openTimeout in class ReceiverOptions
        Parameters:
        timeout - Timeout value to wait for a remote response.
        units - The TimeUnit that defines the timeout span.
        Returns:
        this ReceiverOptions instance.
      • drainTimeout

        public StreamReceiverOptions drainTimeout​(long drainTimeout)
        Description copied from class: ReceiverOptions
        Sets the drain timeout (in milliseconds) after which a Receiver request to drain link credit is considered failed and the request will be marked as such.
        Overrides:
        drainTimeout in class ReceiverOptions
        Parameters:
        drainTimeout - the drainTimeout to use for receiver links.
        Returns:
        this ReceiverOptions instance.
      • drainTimeout

        public StreamReceiverOptions drainTimeout​(long timeout,
                                                  java.util.concurrent.TimeUnit units)
        Description copied from class: ReceiverOptions
        Sets the drain timeout value after which a Receiver request to drain link credit is considered failed and the request will be marked as such.
        Overrides:
        drainTimeout in class ReceiverOptions
        Parameters:
        timeout - Timeout value to wait for a remote response.
        units - The TimeUnit that defines the timeout span.
        Returns:
        this ReceiverOptions instance.
      • requestTimeout

        public StreamReceiverOptions requestTimeout​(long requestTimeout)
        Description copied from class: ReceiverOptions
        Configures the timeout used when awaiting a response from the remote that a request to perform some action such as starting a new transaction. If the remote does not respond within the configured timeout the resource making the request will mark it as failed and return an error to the request initiator usually in the form of a ClientOperationTimedOutException.
        Overrides:
        requestTimeout in class ReceiverOptions
        Parameters:
        requestTimeout - Timeout value in milliseconds to wait for a remote response.
        Returns:
        this ReceiverOptions instance.
      • requestTimeout

        public StreamReceiverOptions requestTimeout​(long timeout,
                                                    java.util.concurrent.TimeUnit units)
        Description copied from class: ReceiverOptions
        Configures the timeout used when awaiting a response from the remote that a request to perform some action such as starting a new transaction. If the remote does not respond within the configured timeout the resource making the request will mark it as failed and return an error to the request initiator usually in the form of a ClientOperationTimedOutException.
        Overrides:
        requestTimeout in class ReceiverOptions
        Parameters:
        timeout - Timeout value to wait for a remote response.
        units - The TimeUnit that defines the timeout span.
        Returns:
        this ReceiverOptions instance.