You're viewing Apigee Edge documentation.
Go to the
Apigee X documentation. info
This document explains how to configure the I/O timeout for the Apigee Edge Message Processors.
The I/O timeout on the Message Processor represents the time for which the Message Processor waits either to receive a response from the backend server or for the socket to be ready to write a request to the backend server, before it times out.
The Message Processor I/O timeout default value is 55 seconds
. This timeout
period is applicable
to the backend servers configured in the target endpoint configuration and in the ServiceCallout
policy of your API proxy.
The I/O timeout for Message Processors can be increased or decreased from the default value of
55 seconds
based on your needs. It can be configured in the following places:
- In the API proxy
- Target endpoint
- ServiceCallout policy
- On the Message Processor
The following properties control the I/O timeout on the Message Processors:
Property Name | Location | Description |
---|---|---|
io.timeout.millis
|
API proxy:
|
This is the maximum time for which the Message Processor does the following:
If there is no response from the backend server within this timeout period, then the Message Processor times out.
By default, this property takes the value set for the
If this property is modified with a new timeout value for a specific API proxy, then only that API proxy is affected. |
HTTPTransport.io.timeout.millis
|
Message Processor |
This is the maximum time for which the Message Processor does the following:
If there is no response from the backend server within this timeout period, then the Message Processor times out. This property is used for all the API Proxies running on this Message Processor.
The default value of this property is
You can either modify this property as explained in
Configuring I/O timeout on Message Processors, or you can
overwrite this value by setting the |
Before you begin
Before you use the steps in this document, be sure you understand the following topics:
- If you aren’t familiar with I/O timeout, see the
io.timeout.millis
property description in TargetEndpoint Transport Property Specification. - If you aren’t familiar with configuring properties for Edge for Private Cloud, read How to configure Edge.
- Ensure that you follow the recommendations in Best practices for configuring I/O timeout.
Configuring I/O timeout in API proxy
The I/O timeout can be configured in the following API proxy places:
- Target endpoint
- ServiceCallout policy
Configuring I/O timeout in target endpoint of API proxy
This section explains how to configure I/O timeout in the target endpoint of your API proxy.
The I/O timeout can be configured through the property io.timeout.millis
, which
represents the I/O timeout value in milliseconds.
- In the Edge UI, select the specific API proxy in which you would like to configure the new I/O timeout value.
- Select the specific target endpoint that you want to modify.
- Add the property
io.timeout.millis
with an appropriate value under the<HTTPTargetConnection>
element in theTargetEndpoint
configuration. - Save the changes made to your API proxy.
For example, to change the I/O Timeout to 120 seconds, add the following block of code:
<Properties> <Property name="io.timeout.millis">120000</Property> </Properties>
Since the io.timeout.millis
property is in milliseconds, the value for
120 seconds is 120000
.
The following examples show how to configure the I/O timeout in the target endpoint configuration of your API proxy:
Example target endpoint configuration using URL for backend server
<TargetEndpoint name="default"> <HTTPTargetConnection> <URL>https://mocktarget.apigee.net/json</URL> <Properties> <Property name="io.timeout.millis">120000</Property> </Properties> </HTTPTargetConnection> </TargetEndpoint>
Example target endpoint configuration using target server
<TargetEndpoint name="default"> <HTTPTargetConnection> <LoadBalancer> <Server name="target1" /> <Server name="target2" /> </LoadBalancer> <Properties> <Property name="io.timeout.millis">120000</Property> </Properties> <Path>/test</Path> </HTTPTargetConnection> </TargetEndpoint>
Configuring I/O timeout in ServiceCallout policy of API proxy
This section explains how to configure the I/O timeout in the ServiceCallout policy of your
API proxy. The I/O timeout can be configured through either the <Timeout>
element
or the io.timeout.millis
property. Both the <Timeout>
element and the
io.timeout.millis
property represent the I/O timeout values in milliseconds.
You can configure the I/O timeout in the ServiceCallout policy using one of the following methods:
<Timeout>
element.io.timeout.millis
property.
Timeout element
To configure the I/O timeout in the ServiceCallout policy using the <Timeout>
element, do the following:
- In the Edge UI, select the specific API proxy in which you would like to configure the new I/O timeout value for the ServiceCallout policy.
- Select the specific ServiceCallout policy that you want to modify.
- Add the element
<Timeout>
with an appropriate value under the<ServiceCallout>
configuration.For example, to change the I/O timeout to 120 seconds, add the following line of code:
<Timeout>120000</Timeout>
Since the
<Timeout>
element is in milliseconds, the value for 120 seconds is120000
.The following example shows how to configure the I/O timeout in the ServiceCallout policy using the
<Timeout>
element:Example ServiceCallout policy configuration using URL for backend server
<ServiceCallout name="Service-Callout-1"> <DisplayName>ServiceCallout-1</DisplayName> <Timeout>120000</Timeout> <HTTPTargetConnection> <Properties/> <URL>https://mocktarget.apigee.net/json</URL> </HTTPTargetConnection> </ServiceCallout>
- Save the changes made to your API proxy.
io.timeout.millis property
To configure the I/O timeout in the ServiceCallout policy using the
io.timeout.millis
property, do the following:
- In the Edge UI, select the specific API proxy in which you would like to configure the new I/O timeout value for the ServiceCallout policy.
- Select the specific ServiceCallout policy that you want to modify.
- Add the property
io.timeout.millis
with an appropriate value under the<HTTPTargetConnection>
element in the TargetEndpoint configuration.For example, to change the I/O timeout to 120 seconds, add the following block of code:
<Properties> <Property name="io.timeout.millis">120000</Property> </Properties>
Since the
io.timeout.millis
property is in milliseconds, the value for 120 seconds is120000
.The following examples show how to configure the I/O timeout in the target endpoint configuration of your API proxy:
Example ServiceCallout policy configuration using URL for backend server
<ServiceCallout name="Service-Callout-1"> <DisplayName>ServiceCallout-1</DisplayName> <HTTPTargetConnection> <Properties> <Property name="io.timeout.millis">120000</Property> </Properties> <URL>https://mocktarget.apigee.net/json</URL> </HTTPTargetConnection> </ServiceCallout>
Example ServiceCallout policy configuration using target server
<ServiceCallout enabled="true" name="Service-Callout-1"> <DisplayName>ServiceCallout-1</DisplayName> <Response>calloutResponse</Response> <HTTPTargetConnection> <LoadBalancer> <Server name="target1" /> <Server name="target2" /> </LoadBalancer> <Properties> <Property name="io.timeout.millis">120000</Property> </Properties> <Path>/test</Path> </HTTPTargetConnection> </ServiceCallout>
- Save the changes made to your API proxy.
Configuring I/O timeout on Message Processors
This section explains how to configure the I/O timeout on the Message Processors.
The I/O timeout can be configured through the property HTTPTransport.io.timeout.millis
,
which represents the I/O timeout value in milliseconds on the Message Processor component,
using the token as per the syntax described in
How to configure
Edge.
To configure the I/O timeout on the Message Processors, do the following:
- On the Message Processor machine, open the following file in an editor. If it does not
already exist, then create it.
/opt/apigee/customer/application/message-processor.properties
For example, to open the file using
vi
, enter the following command:vi /opt/apigee/customer/application/message-processor.properties
- Add a line in the following format to the properties file, substituting a value for
TIME_IN_MILLISECONDS:
conf_http_HTTPTransport.io.timeout.millis=TIME_IN_MILLISECONDS
For example, to change the I/O timeout on the Message Processor to 120 seconds, add the following line:
conf_http_HTTPTransport.io.timeout.millis=120000
- Save your changes.
- Ensure the properties file is owned by the
apigee
user as shown below:chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
- Restart the Message Processor as shown below:
/opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
- If you have more than one Message Processor, repeat the above steps on all the Message Processors.
Verifying I/O timeout on Message Processors
This section explains how to verify that the I/O timeout has been successfully modified on the Message Processors.
Even though you use the token conf_http_HTTPTransport.io.timeout.millis
to set the
I/O timeout on the Message Processor, you need to verify if the actual property
HTTPTransport.io.timeout.millis
has been set with the new value.
- On the Message Processor machine, search for the property
HTTPTransport.io.timeout.millis
in the/opt/apigee/edge-message-processor/conf
directory and check to see if it has been set with the new value as shown below:grep -ri "HTTPTransport.io.timeout.millis" /opt/apigee/edge-message-processor/conf
- If the new I/O timeout value is successfully set on the Message Processor, then the above
command shows the new value in the
http.properties
file. - If you still see the old value for the property
HTTPTransport.io.timeout.millis
, then verify that you have followed all the steps outlined in Configuring I/O timeout on Message Processors correctly. If you have missed any step, repeat all the steps again correctly. - If you are still not able to modify the I/O timeout, then please contact Apigee Edge Support.
The sample result from the above command after you have configured I/O timeout to 120 seconds is as follows:
/opt/apigee/edge-message-processor/conf/http.properties:HTTPTransport.io.timeout.millis=120000
In the example output above, notice that the property
HTTPTransport.io.timeout.millis
has been set with the new value 120000
in
http.properties
. This indicates that the I/O timeout is successfully configured
to 120 seconds on the Message Processor.
What’s next?
Learn about Configuring I/O timeout on Routers