Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

WSO2 API Manager suspends your API if the endpoint of your API cannot be reached. The default suspension time is 30 seconds. Any request to your API will not be able to reach your endpoint for 30 seconds and will return an error message as shown below.

<am:fault xmlns:am="http://wso2.org/apimanager">
<am:code>303001</am:code>
<am:type>Status report</am:type>
<am:message>Runtime Error</am:message>
<am:description>Currently , Address endpoint : [ Name : somename-AT-sometenant--test_me_APIproductionEndpoint_0 ] [ State : SUSPENDED ]</am:description>
</am:fault>


To prevent or turn off API suspension do the following:

  1. Log into API Publisher (https://<HostName>:9443/publisher). Select your API and click Edit API.
  2. Go to Implement and click the cogwheel icon next to the endpoint you want to re-configure.
  3. In the Advanced Settings dialog box that appears, change Initial Duration and Max Duration. To turn off suspension, set both values to zero.
  4. Click Save and re-publish the API.

For more details about creating and publishing an API, see Create and Publish an API.

If you are using WSO2 ESB, do the following to avoid backend endpoint suspension.

  1. Go to <APIM_HOME>/repository/deployment/server/synapse-configs/default/api
  2. Open the configuration file of the API, that has to be prevented from being suspended. (e.g. admin--testApi_v1.0.0.xml)
  3. Add the following configurations

     <endpoint name="admin--testApi_APIproductionEndpoint_0">
     	<address uri="http://localhost:9000/services/SimpleStockQuoteService">
    		<timeout>
    			<duration>30000</duration>
    			<responseAction>fault</responseAction>
    		</timeout>
    		<suspendOnFailure>
    			<errorCodes>-1</errorCodes>
    			<initialDuration>0</initialDuration>
    			<progressionFactor>1.0</progressionFactor>
    			<maximumDuration>0</maximumDuration>
    		</suspendOnFailure>
    		<markForSuspension>
    			<errorCodes>-1</errorCodes>
    		</markForSuspension>
    	</address>
     </endpoint>

For more details on configuring different timeouts, see Timeout configurations for an API call in the Performance guide.

  • No labels