Class MessagingBackPressureConfig
- java.lang.Object
-
- io.hekate.messaging.MessagingBackPressureConfig
-
public class MessagingBackPressureConfig extends Object
Back pressure configuration of aMessagingChannel
.
-
-
Constructor Summary
Constructors Constructor Description MessagingBackPressureConfig()
Constructs a new instance.MessagingBackPressureConfig(MessagingBackPressureConfig src)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getInHighWatermark()
Returns the high watermark of inbound (receiving) queue size (seesetOutHighWatermark(int)
).int
getInLowWatermark()
Returns the low watermark of inbound (receiving) queue size (seesetInLowWatermark(int)
).int
getOutHighWatermark()
Returns the high watermark of outbound (sending) queue size (seesetOutHighWatermark(int)
).int
getOutLowWatermark()
Returns the low watermark of outbound (sending) queue size (seesetOutLowWatermark(int)
).MessagingOverflowPolicy
getOutOverflowPolicy()
Returns the policy that should be applied whenMessagingChannel
's outbound (sending) queue size exceeds thelimit
(seesetOutOverflowPolicy(MessagingOverflowPolicy)
).void
setInHighWatermark(int inHighWatermark)
Sets the high watermark of inbound (receiving) queue size.void
setInLowWatermark(int inLowWatermark)
Sets the low watermark of inbound (receiving) queue size.void
setOutHighWatermark(int outHighWatermark)
Sets the high watermark of outbound (sending) queue size.void
setOutLowWatermark(int outLowWatermark)
Sets the low watermark of outbound (sending) queue size.void
setOutOverflowPolicy(MessagingOverflowPolicy outOverflowPolicy)
Sets the policy that should be applied whenMessagingChannel
's outbound (sending) queue size exceeds thelimit
.String
toString()
MessagingBackPressureConfig
withInHighWatermark(int inHighWatermark)
Fluent-style version ofsetInHighWatermark(int)
.MessagingBackPressureConfig
withInLowWatermark(int inLowWatermark)
Fluent-style version ofsetInLowWatermark(int)
.MessagingBackPressureConfig
withOutHighWatermark(int outHighWatermark)
Fluent-style version ofsetOutHighWatermark(int)
.MessagingBackPressureConfig
withOutLowWatermark(int outLowWatermark)
Fluent-style version ofsetOutLowWatermark(int)
.MessagingBackPressureConfig
withOutOverflowPolicy(MessagingOverflowPolicy outOverflow)
Fluent-style version ofsetOutOverflowPolicy(MessagingOverflowPolicy)
.
-
-
-
Constructor Detail
-
MessagingBackPressureConfig
public MessagingBackPressureConfig()
Constructs a new instance.
-
MessagingBackPressureConfig
public MessagingBackPressureConfig(MessagingBackPressureConfig src)
Copy constructor.- Parameters:
src
- Copy from.
-
-
Method Detail
-
getInLowWatermark
public int getInLowWatermark()
Returns the low watermark of inbound (receiving) queue size (seesetInLowWatermark(int)
).- Returns:
- Low watermark of inbound queue size.
-
setInLowWatermark
public void setInLowWatermark(int inLowWatermark)
Sets the low watermark of inbound (receiving) queue size.Value of this parameter must be less than the value of
setInHighWatermark(int)
parameter.- Parameters:
inLowWatermark
- Low watermark of inbound queue size.- See Also:
setInHighWatermark(int)
-
withInLowWatermark
public MessagingBackPressureConfig withInLowWatermark(int inLowWatermark)
Fluent-style version ofsetInLowWatermark(int)
.- Parameters:
inLowWatermark
- Low watermark of inbound queue size.- Returns:
- This instance.
-
getInHighWatermark
public int getInHighWatermark()
Returns the high watermark of inbound (receiving) queue size (seesetOutHighWatermark(int)
).- Returns:
- High watermark of inbound queue size.
-
setInHighWatermark
public void setInHighWatermark(int inHighWatermark)
Sets the high watermark of inbound (receiving) queue size.If value of this parameter is less than or equals to zero (default) then back pressure will not be applied to inbound message queue.
- Parameters:
inHighWatermark
- High watermark of inbound queue size.- See Also:
setInLowWatermark(int)
-
withInHighWatermark
public MessagingBackPressureConfig withInHighWatermark(int inHighWatermark)
Fluent-style version ofsetInHighWatermark(int)
.- Parameters:
inHighWatermark
- High watermark of inbound queue size.- Returns:
- This instance.
-
getOutLowWatermark
public int getOutLowWatermark()
Returns the low watermark of outbound (sending) queue size (seesetOutLowWatermark(int)
).- Returns:
- Low watermark of outbound queue size.
-
setOutLowWatermark
public void setOutLowWatermark(int outLowWatermark)
Sets the low watermark of outbound (sending) queue size.This parameter is mandatory only if
setOutOverflowPolicy(MessagingOverflowPolicy)
is set to any other value besidesMessagingOverflowPolicy.IGNORE
. Value of this parameter must be less than the value ofsetOutHighWatermark(int)
parameter.- Parameters:
outLowWatermark
- Low watermark of outbound queue size.- See Also:
setOutHighWatermark(int)
,setOutOverflowPolicy(MessagingOverflowPolicy)
-
withOutLowWatermark
public MessagingBackPressureConfig withOutLowWatermark(int outLowWatermark)
Fluent-style version ofsetOutLowWatermark(int)
.- Parameters:
outLowWatermark
- Low watermark of outbound queue size.- Returns:
- This instance.
-
getOutHighWatermark
public int getOutHighWatermark()
Returns the high watermark of outbound (sending) queue size (seesetOutHighWatermark(int)
).- Returns:
- High watermark of outbound queue size.
-
setOutHighWatermark
public void setOutHighWatermark(int outHighWatermark)
Sets the high watermark of outbound (sending) queue size.This parameter is mandatory only if
setOutOverflowPolicy(MessagingOverflowPolicy)
is set to any other value besidesMessagingOverflowPolicy.IGNORE
.- Parameters:
outHighWatermark
- High watermark of outbound queue size.- See Also:
setOutLowWatermark(int)
,setOutOverflowPolicy(MessagingOverflowPolicy)
-
withOutHighWatermark
public MessagingBackPressureConfig withOutHighWatermark(int outHighWatermark)
Fluent-style version ofsetOutHighWatermark(int)
.- Parameters:
outHighWatermark
- High watermark of outbound queue size.- Returns:
- This instance.
-
getOutOverflowPolicy
public MessagingOverflowPolicy getOutOverflowPolicy()
Returns the policy that should be applied whenMessagingChannel
's outbound (sending) queue size exceeds thelimit
(seesetOutOverflowPolicy(MessagingOverflowPolicy)
).- Returns:
- Policy.
-
setOutOverflowPolicy
public void setOutOverflowPolicy(MessagingOverflowPolicy outOverflowPolicy)
Sets the policy that should be applied whenMessagingChannel
's outbound (sending) queue size exceeds thelimit
.Default value of this parameter is
MessagingOverflowPolicy.IGNORE
. If any other value is specified thensetOutHighWatermark(int)
must be set to a value that is greater than zero.- Parameters:
outOverflowPolicy
- Policy.
-
withOutOverflowPolicy
public MessagingBackPressureConfig withOutOverflowPolicy(MessagingOverflowPolicy outOverflow)
Fluent-style version ofsetOutOverflowPolicy(MessagingOverflowPolicy)
.- Parameters:
outOverflow
- Policy.- Returns:
- This instance.
-
-