Package akka.stream

Class ActorMaterializerSettings


  • public final class ActorMaterializerSettings
    extends java.lang.Object
    This class describes the configurable properties of the ActorMaterializer. Please refer to the withX methods for descriptions of the individual settings.

    The constructor is not public API, use create or apply on the ActorMaterializerSettings companion instead.

    • Constructor Detail

      • ActorMaterializerSettings

        public ActorMaterializerSettings​(int initialInputBufferSize,
                                         int maxInputBufferSize,
                                         java.lang.String dispatcher,
                                         scala.Function1<java.lang.Throwable,​Supervision.Directive> supervisionDecider,
                                         StreamSubscriptionTimeoutSettings subscriptionTimeoutSettings,
                                         boolean debugLogging,
                                         int outputBurstLimit,
                                         boolean fuzzingMode,
                                         boolean autoFusing,
                                         int maxFixedBufferSize,
                                         int syncProcessingLimit,
                                         IOSettings ioSettings)
        Deprecated.
        Use ActorMaterializerSettings.apply or ActorMaterializerSettings.create instead. Since 2.5.10.
      • ActorMaterializerSettings

        public ActorMaterializerSettings​(int initialInputBufferSize,
                                         int maxInputBufferSize,
                                         java.lang.String dispatcher,
                                         scala.Function1<java.lang.Throwable,​Supervision.Directive> supervisionDecider,
                                         StreamSubscriptionTimeoutSettings subscriptionTimeoutSettings,
                                         boolean debugLogging,
                                         int outputBurstLimit,
                                         boolean fuzzingMode,
                                         boolean autoFusing,
                                         int maxFixedBufferSize,
                                         int syncProcessingLimit)
        Deprecated.
        Use ActorMaterializerSettings.apply or ActorMaterializerSettings.create instead. Since 2.5.10.
      • ActorMaterializerSettings

        public ActorMaterializerSettings​(int initialInputBufferSize,
                                         int maxInputBufferSize,
                                         java.lang.String dispatcher,
                                         scala.Function1<java.lang.Throwable,​Supervision.Directive> supervisionDecider,
                                         StreamSubscriptionTimeoutSettings subscriptionTimeoutSettings,
                                         boolean debugLogging,
                                         int outputBurstLimit,
                                         boolean fuzzingMode,
                                         boolean autoFusing,
                                         int maxFixedBufferSize)
        Deprecated.
        Use ActorMaterializerSettings.apply or ActorMaterializerSettings.create instead. Since 2.5.10.
    • Method Detail

      • apply

        public static ActorMaterializerSettings apply​(int initialInputBufferSize,
                                                      int maxInputBufferSize,
                                                      java.lang.String dispatcher,
                                                      scala.Function1<java.lang.Throwable,​Supervision.Directive> supervisionDecider,
                                                      StreamSubscriptionTimeoutSettings subscriptionTimeoutSettings,
                                                      boolean debugLogging,
                                                      int outputBurstLimit,
                                                      boolean fuzzingMode,
                                                      boolean autoFusing,
                                                      int maxFixedBufferSize)
        Deprecated.
        Create the settings using the apply(system) or apply(config) method, and then modify them using the .with methods. Since 2.5.10.
        Create ActorMaterializerSettings from individual settings (Scala).
        Parameters:
        initialInputBufferSize - (undocumented)
        maxInputBufferSize - (undocumented)
        dispatcher - (undocumented)
        supervisionDecider - (undocumented)
        subscriptionTimeoutSettings - (undocumented)
        debugLogging - (undocumented)
        outputBurstLimit - (undocumented)
        fuzzingMode - (undocumented)
        autoFusing - (undocumented)
        maxFixedBufferSize - (undocumented)
        Returns:
        (undocumented)
      • create

        public static ActorMaterializerSettings create​(int initialInputBufferSize,
                                                       int maxInputBufferSize,
                                                       java.lang.String dispatcher,
                                                       scala.Function1<java.lang.Throwable,​Supervision.Directive> supervisionDecider,
                                                       StreamSubscriptionTimeoutSettings subscriptionTimeoutSettings,
                                                       boolean debugLogging,
                                                       int outputBurstLimit,
                                                       boolean fuzzingMode,
                                                       boolean autoFusing,
                                                       int maxFixedBufferSize)
        Deprecated.
        Create the settings using the create(system) or create(config) method, and then modify them using the .with methods. Since 2.5.10.
        Create ActorMaterializerSettings from individual settings (Java).
        Parameters:
        initialInputBufferSize - (undocumented)
        maxInputBufferSize - (undocumented)
        dispatcher - (undocumented)
        supervisionDecider - (undocumented)
        subscriptionTimeoutSettings - (undocumented)
        debugLogging - (undocumented)
        outputBurstLimit - (undocumented)
        fuzzingMode - (undocumented)
        autoFusing - (undocumented)
        maxFixedBufferSize - (undocumented)
        Returns:
        (undocumented)
      • initialInputBufferSize

        public int initialInputBufferSize()
      • maxInputBufferSize

        public int maxInputBufferSize()
      • dispatcher

        public java.lang.String dispatcher()
      • supervisionDecider

        public scala.Function1<java.lang.Throwable,​Supervision.Directive> supervisionDecider()
      • debugLogging

        public boolean debugLogging()
      • outputBurstLimit

        public int outputBurstLimit()
      • fuzzingMode

        public boolean fuzzingMode()
      • autoFusing

        public boolean autoFusing()
      • maxFixedBufferSize

        public int maxFixedBufferSize()
      • syncProcessingLimit

        public int syncProcessingLimit()
      • blockingIoDispatcher

        public java.lang.String blockingIoDispatcher()
      • withInputBuffer

        public ActorMaterializerSettings withInputBuffer​(int initialSize,
                                                         int maxSize)
        Each asynchronous piece of a materialized stream topology is executed by one Actor that manages an input buffer for all inlets of its shape. This setting configures the default for initial and maximal input buffer in number of elements for each inlet. This can be overridden for individual parts of the stream topology by using Attributes.inputBuffer(int, int).

        FIXME: this is used for all kinds of buffers, not only the stream actor, some use initial some use max, document and or fix if it should not be like that. Search for get[Attributes.InputBuffer] to see how it is used

        Parameters:
        initialSize - (undocumented)
        maxSize - (undocumented)
        Returns:
        (undocumented)
      • withDispatcher

        public ActorMaterializerSettings withDispatcher​(java.lang.String dispatcher)
        This setting configures the default dispatcher to be used by streams materialized with the ActorMaterializer. This can be overridden for individual parts of the stream topology by using akka.stream.Attributes#dispatcher.
        Parameters:
        dispatcher - (undocumented)
        Returns:
        (undocumented)
      • withSupervisionStrategy

        public ActorMaterializerSettings withSupervisionStrategy​(scala.Function1<java.lang.Throwable,​Supervision.Directive> decider)
        Scala API: Decides how exceptions from application code are to be handled, unless overridden for specific flows of the stream operations with akka.stream.Attributes#supervisionStrategy.

        Note that supervision in streams are implemented on a per operator basis and is not supported by every operator.

        Parameters:
        decider - (undocumented)
        Returns:
        (undocumented)
      • withSupervisionStrategy

        public ActorMaterializerSettings withSupervisionStrategy​(Function<java.lang.Throwable,​Supervision.Directive> decider)
        Java API: Decides how exceptions from application code are to be handled, unless overridden for specific flows of the stream operations with akka.stream.Attributes#supervisionStrategy.

        Note that supervision in streams are implemented on a per operator basis and is not supported by every operator.

        Parameters:
        decider - (undocumented)
        Returns:
        (undocumented)
      • withFuzzing

        public ActorMaterializerSettings withFuzzing​(boolean enable)
        Test utility: fuzzing mode means that GraphStage events are not processed in FIFO order within a fused subgraph, but randomized.
        Parameters:
        enable - (undocumented)
        Returns:
        (undocumented)
      • withOutputBurstLimit

        public ActorMaterializerSettings withOutputBurstLimit​(int limit)
        Maximum number of elements emitted in batch if downstream signals large demand.
        Parameters:
        limit - (undocumented)
        Returns:
        (undocumented)
      • withSyncProcessingLimit

        public ActorMaterializerSettings withSyncProcessingLimit​(int limit)
        Limit for number of messages that can be processed synchronously in stream to substream communication
        Parameters:
        limit - (undocumented)
        Returns:
        (undocumented)
      • withDebugLogging

        public ActorMaterializerSettings withDebugLogging​(boolean enable)
        Enable to log all elements that are dropped due to failures (at DEBUG level).
        Parameters:
        enable - (undocumented)
        Returns:
        (undocumented)
      • withAutoFusing

        public ActorMaterializerSettings withAutoFusing​(boolean enable)
        Deprecated.
        Turning off fusing is no longer possible with the traversal based materializer. Since 2.5.0.
        Enable automatic fusing of all graphs that are run. For short-lived streams this may cause an initial runtime overhead, but most of the time fusing is desirable since it reduces the number of Actors that are created.
        Parameters:
        enable - (undocumented)
        Returns:
        (undocumented)
      • withMaxFixedBufferSize

        public ActorMaterializerSettings withMaxFixedBufferSize​(int size)
        Configure the maximum buffer size for which a FixedSizeBuffer will be preallocated. This defaults to a large value because it is usually better to fail early when system memory is not sufficient to hold the buffer.
        Parameters:
        size - (undocumented)
        Returns:
        (undocumented)
      • withBlockingIoDispatcher

        public ActorMaterializerSettings withBlockingIoDispatcher​(java.lang.String newBlockingIoDispatcher)
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object