org.wildfly.swarm.microprofile.faulttolerance.deployment

## Class HystrixCommandInterceptor

- java.lang.Object
- - org.wildfly.swarm.microprofile.faulttolerance.deployment.HystrixCommandInterceptor

-     @HystrixCommandBinding
      public class HystrixCommandInterceptor
      extends Object

  ## Implementation notes:

  If `SynchronousCircuitBreaker` is used it is not possible to track the execution inside a Hystrix command because a `TimeoutException` should be always counted as a failure, even if the command execution completes normally.

  We never use `HystrixCommand#queue()` for async execution. Mostly to workaround various problems of `Asynchronous` `Retry` combination. Instead, we create a composite command and inside its run() method we execute commands synchronously.

  Author:
    Antoine Sabot-Durand, Martin Kouba

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `SYNC_CIRCUIT_BREAKER_KEY` This config property key can be used to disable synchronous circuit breaker functionality.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HystrixCommandInterceptor(Boolean nonFallBackEnable, Config config, <any> fraction, BeanManager beanManager)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `interceptCommand(InvocationContext ic)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SYNC_CIRCUIT_BREAKER_KEY

          public static final String SYNC_CIRCUIT_BREAKER_KEY

      This config property key can be used to disable synchronous circuit breaker functionality. If disabled, `CircuitBreaker#successThreshold()` of value greater than 1 is not supported.

      Moreover, circuit breaker does not necessarily transition from CLOSED to OPEN immediately when a fault tolerance operation completes. See also Hystrix configuration

      In general, application developers are encouraged to disable this feature on high-volume circuits and in production environments.

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HystrixCommandInterceptor

          public HystrixCommandInterceptor(Boolean nonFallBackEnable,
                                           Config config,
                                           <any> fraction,
                                           BeanManager beanManager)

  - ### Method Detail

    - #### interceptCommand

          public Object interceptCommand(InvocationContext ic)
                                  throws Exception

      Throws:
        `Exception`

Copyright © 2018 JBoss by Red Hat. All rights reserved.