You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> NOTE: Please see `docs` configuration entry explained above.
135
141
142
+
## Timeouts and Unavailability
143
+
We can restrict requests timeouts globally, at service level using the `timeout` configuration.
144
+
To define an endpoint specific timeout, you can use the property `timeout` of the request object, normally inside a middleware:
145
+
```js
146
+
req.timeout=500// define a 500ms timeout on a custom request.
147
+
```
148
+
> NOTE: You might want to also check https://www.npmjs.com/package/middleware-if-unless
149
+
150
+
### Circuit Breaker
151
+
By using the `proxyHandler` hook, developers can optionally intercept and modify the default gateway routing behavior right before the origin request is proxied to the remote service. Therefore, connecting advanced monitoring mechanisms like [Circuit Breakers](https://martinfowler.com/bliki/CircuitBreaker.html) is rather simple.
152
+
153
+
Please see the `demos/circuitbreaker.js` example for more details using the `opossum` library.
154
+
136
155
## Gateway level caching
137
156
Caching support is provided by the `http-cache-middleware` module. https://www.npmjs.com/package/http-cache-middleware
0 commit comments