KB Article #178527
Customize Connect to URL filter use by API Manager
Problem
-- How to customize the Connect to URL filter use by API Manager to connect to backend server?
Resolution
- API Manager use a template Connect to URL filter in order to connect to backend server, this filter is under Policies > Generated Policies > REST API's > Templates > Default URL-based Routing.
- It is possible to edit this filter to customize it, but take care, modifying it too much can break API Manager behaviour. As example, do not change the name of this filter.
- A possible customization is to make API Manager return a 504 http status code if the backend server can't be reach:
- Create a Policy containing a Reflect Message Filter with the HTTP response code status sets to 504
- Edit the Conncet to URL filter under Policies > Generated Policies > REST API's > Templates > Default URL-based Routing and under Settings > Failure tick the Call policy on Connection Failure option and link the policy create previouly in Connection Failure Policy
- Deploy configuration
- API Gateway instance has to be restarted to apply this modification
Now, API Manager will return http status code 504 to client, instead of 500, if backend server can't be reach.