From the understanding, Hystrix fallback logic is triggered when certain conditions occurred such as Request timeout, thread-pool running at a capacity of 100% or dependency throws exception. Beside these 3 factors can I add more conditions that are also considered as failures such as any specific HTTP Error code like 413 (payload too large)?
Custom error conditions to trigger fallback in Hystrix
1.9k Views Asked by colossal At
1
There are 1 best solutions below
Related Questions in REST
- Spring RestTemplate passing the type of the response
- .net rest service with JSON string and consumed with java client
- SuiteCRM how to retrieve all account related contacts
- http status code for failed email send
- cloud foundry - 413 Request Entity Too Large
- Why does PHP add "\r\n" to an empty string?
- WCF Service not accepting multiple body parameters
- How to send Rest GET request that contains "#" value in url parameters?
- Phalcon PHP - RESTful API
- Object of class CS_REST_Wrapper_Result could not be converted to string in CAMPAIGN MONITOR
- purchase individual items and subscriptions in the same PayPal REST API transaction
- Empty Response Received on Android POST Request
- angular load more tweets onclick
- Async vs Horizontal scaling
- Responding to an Office 365 event invite via REST
Related Questions in HYSTRIX
- Should Hystrix replace existing JDBC/HTTP connection pools, or delegate to them?
- Override Hystrix properties when using Spring Cloud Netflix
- Hystrix command requiring cleanup when timed-out
- Hystrix: Doing network call in getFallBack()
- Spring Microservices issue with @HystrixCommand
- Issue with @EnableCircuitBreaker annotation when running springboot service in local environment
- Use hystrix when called service do not return anything or null
- spring boot hystrix integration
- Hystrix fallback method is not invoked
- Mockito throws NPE when stubbing method from base class
- Wiremock Hystrix failure on upgrade
- hystrix stream not responding
- Hystrix: Unable to connect to Command Metric Stream
- How to set custom Feign client connection timeout?
- Feign - handling underling Exceptions - propagating error status
Related Questions in NETFLIX
- Extract files from Chrome OS / Chromebook recovery image
- Redirecting feign & ribbon logs to log4j2
- Hystrix: Doing network call in getFallBack()
- Creating custom Zuul filters
- NetflixOSS Zuul Filter for rejecting requests
- Add Zuul to Netflix OSS installation
- React Native (Netflix app) Android build error - "Could not find 'store' in either the context or props of Connect(App)"
- Eureka client fetching registry from Eureka server
- Working with Vizceral and Elastic Search
- Netflix Zuul - Lookup metadata to influence routing?
- Netflix/Hulu system architecture
- Setting up Netflix Hystrix to use the metrics dashboard
- Inferring missing data with Restricted Boltzmann Machines
- Movie image not displaying top of webpage
- How to play prime or Netflix video in mobile developer player (flutter/ios/android/reactnative)?
Related Questions in RESILIENCY
- Should Hystrix replace existing JDBC/HTTP connection pools, or delegate to them?
- Mitigating Hadoop's Achilles tendons
- Starting with Polly basics
- How to make Dapper resilient for SqlAzure?
- How to use SqlRetryLogicBaseProvider to retry connections during Azure SQL scaling up/down
- Why use AWS ELB over Route53 considering cost?
- Should we handle a lambda container crash?
- Polly fallback action did not throw the specified exception. What happened?
- What are the downside of having more db connections open than required?
- Resiliency during SaveChanges in EntityFrameworkCore
- Pool of dependencies rahter than one in Hystrix
- Custom error conditions to trigger fallback in Hystrix
- If RPC node crashes in private Ethereum network, transactions in mempool might be lost?
- Entity Framework Multiple Result Sets, Azure Connection Resiliency and Command Interception
- ReactJS Application - resiliency VS failing fast
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The fallback method of Hystrix will be called under the following condition
Only part that is directly related to the user code is execution fail.
In this case, fallback will be triggered by any exception thrown by
run()method. It is same for pure Hystrix via HystrixCommand and Hystrix Javanica via annotation.Only one exception that doesn't trigger HystrixBadRequestException
Therefore, if you want to trigger your fallback also for HTTP 413 status code, all you have to is just throwing any exception inside your method.
If you're using any library that has built-in Hystrix support like Spring Cloud Feign, you need to implement something that library requires. In case of Spring Cloud Feign, you can implement your own
ErrorDecoder. The default error decoder will trigger fallback for all 4XX,5XX errors. If you don't want to trigger any fallback 4XX errors except 413, you can throwHystrixBadRequestExceptioninside it.