I am using wso2 esb4.9 on windows7. The JDK is 7.0.
I want to let esb to retry 5 times when timeout error happens.
ESB log display 5 times retry...
But there is no retry log is printed...
<endpoint name="Sample_First" statistics="enable" >
<address uri="http://localhost/myendpoint" statistics="enable" trace="disable">
<timeout>
<duration>60000</duration>
</timeout>
<markForSuspension>
<errorCodes>101504, 101505</errorCodes>
<retriesBeforeSuspension>5</retriesBeforeSuspension>
<retryDelay>1</retryDelay>
</markForSuspension>
<suspendOnFailure>
<errorCodes>101500, 101501, 101506, 101507, 101508</errorCodes>
<initialDuration>1000</initialDuration>
<progressionFactor>2</progressionFactor>
<maximumDuration>60000</maximumDuration>
</suspendOnFailure>
</address>
</endpoint>
As I understand you are asking whether ESB tries to connect to the endpoint 4 more times if it gets timed out (fails to connect). This is not the idea of <retriesBeforeSuspension> tag. This integer means ESB marks that endpoint as a SUSPENDED endpoint if 4(as per your configuration) more requests get timed out consecutively. These other requests should be done manually and its not done by ESB automatically. Thats the reason you don't see retry log 5 times.
Hope this helps.
Related
We can see calls going from ESB to backend system old Ip instead of the new IP. For example
Wso2 ESB Endpoint configured as: somebackend.com
If we do nslookup to see the IP of the system.
$nslookup somebackend.com
10.20.30.40
If we trace the traffic from ESB using tcpdump with host as "somebackend.com" then calls are going to old IP of the system (somebackend.com) i,e, 50.60.70.80 instead of new IP 10.20.30.40
Is the name/Ip/DNS Name is cached anywhere in the WSo2 ESB.?
Any suggestions, please resolve this.
Below is the endpoint file configured.
<endpoint xmlns="http://ws.apache.org/ns/synapse"
name="conf//endpoint/endpointname">
<property name="System-Name" value="Backend" scope="default" type="STRING"/>
<http uri-template="somebackend.com"
method="get">
<suspendOnFailure>
<errorCodes>-1</errorCodes>
<initialDuration>0</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>0</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<errorCodes>-1</errorCodes>
</markForSuspension>
</http>
</endpoint>
Can you check in your /etc/hosts file whether you have wrongly mapped the old IP to the domain name (somebackend.com)? It might be a possibility because AFAIK ESB does not cache IP. Maybe restarting the ESB server would also help.
AFAIR WSO2 ESB does not cache endpoint IPs. Can you run a traceroute command on "somebackend.com" from the ESB node and check whether how DNS resolves from your machine?
Wso2 will store the connection details in connection pool and re-use the same connection details for the next calls instead new one. We added below property before making a call to the endpoint to initiate a fresh new connection for each call which resolved our issue.
FYI: https://docs.wso2.com/display/ESB490/HTTP+Transport+Properties
Thanks for the support guys.
I have setted configure and endpoint timeout but it have below response.
What should I pay attention if I want to increase endpoint timeout?
<html>
<body>
<h1>504 Gateway Time-out</h1>
The server didn't respond in time.
</body>
</html>
There are 3 steps to set timeout but it appear fault....
1) Global timeout defined in synapse.properties (EI_HOME\conf\synapse.properties)
synapse.global_timeout_interval=17000000
2) Socket timeout defined in the passthru-http.properties (EI_HOME\conf\passthru-http.properties )
http.socket.timeout=18000000
3) Also set timeout in API.
<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="ep_dsData" xmlns="http://ws.apache.org/ns/synapse">
<http method="post" uri-template="{uri.var.origin.ds}/api/v1/GetData">
<timeout>
<duration>17000000</duration>
<responseAction>fault</responseAction>
</timeout>
</http>
</endpoint>
The following link clearly explains the configurations requried for tuning the timeout variables in WSO2 EI. Please refer it once again.
https://docs.wso2.com/display/EI611/WSO2+Enterprise+Integrator+Best+Practices#WSO2EnterpriseIntegratorBestPractices-Workingwithendpoints
The timeout limit shared in the question is very abnormal, 5 hours.
Remember, the following..
http.socket.timeout > max(Global endpoint timeout,Timeout of individual endpoints).
Also if you have configured a timeout value at the endpoint level, the global timeout value is not taken into consideration for that endpoint. For all the other endpoints, which do not have a timeout value configured, the global value is considered as the timeout value.
I'm using WSO2 ESB to route API requests send to an application hosted on Heroku, through proxy service.
In the last few days, we've noticed connections to the Heroku app would timeout from time to time, resulting in the failure of the whole client process.
Those requests are part of a long process (video transcoding), so relaunching the entire process just because 1 out of 40 requests failed is not really an option. It would be best to retry every failed request automatically a second (or n) time(s).
Implementing "retry on timeout" directly into client code is a mess, so we thought the could handle it for us by configuring the endpoint to retry all timed out requests. The WSO2 ESB documentation on endpoint error handling, advertises it's possible by setuping a failover group that contains only one leaf endpoint, dealing with my exact use case when "even rare message failures are not acceptable".
However, the provided sample configuration seem to continue dropping messages:
<endpoint name="SampleFailover">
<failover>
<endpoint name="Sample_First" statistics="enable" >
<address uri="http://localhost/myendpoint" statistics="enable" trace="disable">
<timeout>
<duration>60000</duration>
</timeout>
<markForSuspension>
<errorCodes>101504, 101505, 101500</errorCodes>
<retriesBeforeSuspension>3</retriesBeforeSuspension>
<retryDelay>1</retryDelay>
</markForSuspension>
<suspendOnFailure>
<initialDuration>1000</initialDuration>
<progressionFactor>2</progressionFactor>
<maximumDuration>64000</maximumDuration>
</suspendOnFailure>
</address>
</endpoint>
</failover>
</endpoint>
I'm still seeing log entries in wso2carbon.log such as:
[2016-04-13 16:02:50,576] WARN - Expiring message ID : urn:uuid:fd515b80-8d67-47e5-b409-0ec39ed58fc6; dropping message after timeout of : 60 seconds {org.apache.synapse.core.axis2.TimeoutHandler}
What am I missing here ?
I add some difficulties with this topic, and it is yet not clear if the endpoint can itself retrigger and timed out call.
After reading this tutorial : https://www.yenlo.com/blog/wso2torial-error-handling-in-wso2-esb-with-wiremock?success=true, it seems that yes, but I'm not sure...
Have you already tried to remveo the error codes ?
<timeout>
<duration>60000</duration>
<responseAction>fault</responseAction>
</timeout>
<suspendOnFailure>
<initialDuration>1000</initialDuration>
<progressionFactor>2.0</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>3</retriesBeforeSuspension>
<retryDelay>1000</retryDelay>
</markForSuspension>
I have been trying to do a poc and WSO2 ESB as a JMS producer and consumer. First thing a could not understand is that how our proxy service will consume the message, do we need to initiate or run the service using tryit or soap ui, or it will consume message every time whenever there is a new message in the queue.
can anyone suggest a link or provide a step by step example for this.
below are my proxy service source:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="NewJMSQueue" transports="jms" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<log level="full"/>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
</inSequence>
</target>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
<parameter name="transport.jms.Destination">NewJMSQueue</parameter>
<description></description>
</proxy>
You can find several examples from here where ESB is used as a JMS consumer and a producer.
When you put the message into the queue the proxy will automatically pick it from the queue. That is by default ESB will be listening on a JMS queue with the same name as the proxy service and when there is a message proxy service will pick that. Note that you have to configure the JMS transport listener in order achieve that.
You need to copy the required libraries to ESB_HOME/repository/components/lib folder (activemq-core-5.7.0.jar, geronimo-j2ee-management_1.1_spec-1.0.1.jar, and geronimo-jms_1.1_spec-1.1.1.jar)
I create a simple WSDL proxy in WSO2 to allow Soap 1.2 enabled applications to work with Soap 1.1 only external web service. Everything is fine except WSO2 doesn't transform soap11 replies back to soap12 when I send request via Soap12 WSO endpoint.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="MySOAP" transports="http"
statistics="disable" trace="disable" startOnLoad="true">
<target>
<endpoint>
<wsdl service="ExtService" port="ExtPort" uri="https://my.local/wsdl/current
/ExtService.wsdl"/>
<property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
</endpoint>
</target>
<publishWSDL uri="file:///home/sysadmin/MySOAP.wsdl"/>
<description></description>
</proxy>
Has anybody faced anything similar? WSO2 ESB version 4.6.0
You need to add the format as following.
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap11" />
</endpoint>
Format - The message format for the endpoint. The available values are:
[format="soap11|soap12|pox|get"]
Leave As-Is - No transformation is done to the outgoing message.
SOAP 1.1 - Transforming message to SOAP 1.1.
SOAP 1.2 - Transforming message to SOAP 1.2.
Plain Old XML (POX) - Transforming to plain old XML format
Representational State Transfer (REST) - Transforming to HTTP Get
Request
GET
http://docs.wso2.org/wiki/display/ESB460/Default+Endpoint
This has been an issue for a while now. See jira https://wso2.org/jira/browse/ESBJAVA-1994.
If you don't want to manually transform your response from the backend, uncomment the relevant NHTTP transport entries in axis2.xml and comment out the HTTP PassThrough transport entries.