Class NotificationProperties
java.lang.Object
com.broadleafcommerce.common.messaging.notification.NotificationProperties
Configuration for a
NotificationHandler
- Author:
- Jeff Fischer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
float
Configures the failure rate threshold in percentage above which the CircuitBreaker should trip open and start short-circuiting calls.int
Configures the size of the ring buffer when the CircuitBreaker is closed.int
Configures the size of the ring buffer when the CircuitBreaker is half open.The length of time a message send attempt should block before timing out.Configures the wait duration which specifies how long the CircuitBreaker should stay open, before it switches to half open.int
hashCode()
boolean
Whether or not sending on the producer channel is allowed.void
setFailureRateThreshold
(float failureRateThreshold) Configures the failure rate threshold in percentage above which the CircuitBreaker should trip open and start short-circuiting calls.void
setRingBufferSizeInClosedState
(int ringBufferSizeInClosedState) Configures the size of the ring buffer when the CircuitBreaker is closed.void
setRingBufferSizeInHalfOpenState
(int ringBufferSizeInHalfOpenState) Configures the size of the ring buffer when the CircuitBreaker is half open.void
setSendEnabled
(boolean sendEnabled) Whether or not sending on the producer channel is allowed.void
setSendTimeout
(Duration sendTimeout) The length of time a message send attempt should block before timing out.void
setWaitDurationInOpenState
(Duration waitDurationInOpenState) Configures the wait duration which specifies how long the CircuitBreaker should stay open, before it switches to half open.toString()
-
Constructor Details
-
NotificationProperties
public NotificationProperties()
-
-
Method Details
-
getFailureRateThreshold
public float getFailureRateThreshold()Configures the failure rate threshold in percentage above which the CircuitBreaker should trip open and start short-circuiting calls. The default is 50. -
getRingBufferSizeInClosedState
public int getRingBufferSizeInClosedState()Configures the size of the ring buffer when the CircuitBreaker is closed. The CircuitBreaker stores the success/failure status of the latest calls in a ring buffer. For example, ifringBufferSizeInClosedState
is 100, then at least 100 calls must be evaluated, before the failure rate can be calculated. If only 99 calls have been evaluated the CircuitBreaker will not trip open even if all 99 calls have failed. The default is 100. -
getRingBufferSizeInHalfOpenState
public int getRingBufferSizeInHalfOpenState()Configures the size of the ring buffer when the CircuitBreaker is half open. The CircuitBreaker stores the success/failure status of the latest calls in a ring buffer. For example, ifringBufferSizeInClosedState
is 10, then at least 10 calls must be evaluated, before the failure rate can be calculated. If only 9 calls have been evaluated the CircuitBreaker will not trip back to closed or open even if all 9 calls have failed. The default is 10. -
getWaitDurationInOpenState
Configures the wait duration which specifies how long the CircuitBreaker should stay open, before it switches to half open. The default is 60 seconds. -
getSendTimeout
The length of time a message send attempt should block before timing out. Such a timeout is considered a failure. The default is 30 seconds. -
isSendEnabled
public boolean isSendEnabled()Whether or not sending on the producer channel is allowed. This will generally always be true, as setting this to false will cause all message sends to fail. Note, this setting can be useful to force engagement of the circuit breaker, or to test failure scenarios. -
setFailureRateThreshold
public void setFailureRateThreshold(float failureRateThreshold) Configures the failure rate threshold in percentage above which the CircuitBreaker should trip open and start short-circuiting calls. The default is 50. -
setRingBufferSizeInClosedState
public void setRingBufferSizeInClosedState(int ringBufferSizeInClosedState) Configures the size of the ring buffer when the CircuitBreaker is closed. The CircuitBreaker stores the success/failure status of the latest calls in a ring buffer. For example, ifringBufferSizeInClosedState
is 100, then at least 100 calls must be evaluated, before the failure rate can be calculated. If only 99 calls have been evaluated the CircuitBreaker will not trip open even if all 99 calls have failed. The default is 100. -
setRingBufferSizeInHalfOpenState
public void setRingBufferSizeInHalfOpenState(int ringBufferSizeInHalfOpenState) Configures the size of the ring buffer when the CircuitBreaker is half open. The CircuitBreaker stores the success/failure status of the latest calls in a ring buffer. For example, ifringBufferSizeInClosedState
is 10, then at least 10 calls must be evaluated, before the failure rate can be calculated. If only 9 calls have been evaluated the CircuitBreaker will not trip back to closed or open even if all 9 calls have failed. The default is 10. -
setWaitDurationInOpenState
Configures the wait duration which specifies how long the CircuitBreaker should stay open, before it switches to half open. The default is 60 seconds. -
setSendTimeout
The length of time a message send attempt should block before timing out. Such a timeout is considered a failure. The default is 30 seconds. -
setSendEnabled
public void setSendEnabled(boolean sendEnabled) Whether or not sending on the producer channel is allowed. This will generally always be true, as setting this to false will cause all message sends to fail. Note, this setting can be useful to force engagement of the circuit breaker, or to test failure scenarios. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-