Connection closed by target host before receiving the request wso2 esb - wso2

I am getting this "Connection closed by target host before receiving the request" due this first system get time out.
But the problem is that we are getting the proper response from second system.
just provide one major problem
after getting the response from second system we are also getting the one more response.
that i am not able to understand.
the arch is
First System ---- > ESB ---->> second system
response
Second system ---->> ESB then we are going the clone
1. send response to first system
2. send request to DSS to log the request.
can you please help in this...
i am using wso2 esb 4.8.1 and i can not change right now it in production.
Regards,
Shachindra Singh

As you explained in your question, it seems connection between the client and the server has timed out. These kind of lagging can be happen due to the back-end slowness or the ESB server contention. Hence Increasing time out settings could be solve this problem.
By default the ESB closes the connection after 60 seconds. So even you increased the client(which send the request)the timeout the problem will not solve.
For your information in WSO2 ESB can set three types of timeouts:
socket timeout - This parameter will decide on the timeout which a
particular http request is waiting for a response.
endpoint timeout - This will help to configure timeout per endpoint.
synapse global timeout - This will decide the maximum time that a
callback is waiting in the ESB for a response for a particular
request.
Please refer below links [1], [2] to find more detailed information about WSO2 ESB Error Handling. Hopefully it will help you to solve the problem.
[1] http://soatutorials.blogspot.com/2015/06/wso2-esb-error-handling-tutorial-part-i.html
[2] https://docs.wso2.com/display/ESB480/Performance+Tuning
Cheers.

Related

libcurl: send GET requests after timeout limit is reached

Problem:
OS: Ubuntu 20.04.1 LTS
When a target URL updates its content, recently libcurl has had unexpected polling delays / timeouts anywhere between 2 and 20+ seconds between sending a GET request to the target URL and receiving any response.
I have no idea what has been causing this behaviour, and have detailed all of the strace reports, tshark results, entire libcurl C++ program, attempts to diagnose, and other terminal outputs at the following SO question, but have had no luck in diagnosing this for about four months:
libcurl: abnormal GET response delays
There seems to be something between the client server and remote server that is stopping packets from being returned, but only when the page changes its content. During this polling delay / timeout, no other requests can be sent - therefore any new data uploaded on the remote server cannot be retrieved quickly.
This issue did not exist before mid-July 2021. Given that after four months this problem still hasn't been solved, I want to attempt a workaround that will still send requests to the target when this polling delay presents itself. I won't understand what caused the polling timeouts, but hopefully I will be able to retrieve the data without delays like the program used to do.
Target URL: https://ir.eia.gov/wpsr/table4.csv
Summary questions:
Q1. Is there a timeout option with libcurl that, when exceeded, the program does not exit but instead sends another GET request to the target URL?
Q2. Since this problem only arises when the target URL makes a scheduled content update, could there be a chance the target URL changes its IP address and thus there is some delay caused by a DNS resolution server in between the client and remote side on the return leg? I am going to attempt to use a tool like pingPlotter to see if there is a delay at some specific IP address between the outbound GET request and the response.
Before any scheduled page content changes, the latency between the outbound GET request and the response is <100 ms.

JMeter Test Result - Connect time is 100% of request (HTTP) sample time

I am using JMeter 5.1 to conduct performance testing (HTTP requests), the system tested is web application on Google Cloud Platform. For JMeter, I configured 10 threads(users), and got error messages for failed request: failed: Connection timed out (Connection timed out)
and check result in "View Results in Table" found Connect time = Sample time and there is no latency time.
Under this condition, What should I try to find the root cause. Is there any analyze direction or method?
You can take a look to this link it explain some causes related to your issue.
In addition, if you are using GCP HTTP(S) Load balancer, you should take a look to stackdriver logs. That will provide more clues for your issue. You may need to change the timeout values for your load balancer or your backend.
This is due to TCP connection timeout, if JMeter fails to get the response within the bounds of the TCP Handshake it will fail the associated HTTP Request sampler.
Latency (also known as TTFB) would be 0 because there is no any response from the server.
same for sent bytes, same for header size in bytes.
If for your application response times over 2 minutes is acceptable and expected you can increase Connect timeout, the relevant setting lives under "Advanced" tab of the HTTP Request sampler (or even better HTTP Request Defaults)
For example this is how you can increase the Connect timeout to 5 minutes:
With regards to root cause, the reasons are numerous, i.e.:
wrong protocol/port combination
the port is blocked by OS firewall or GCP firewall
the application or VM is overloaded and cannot respont
incorrect configuration of application server/database/other middleware
etc.

WSO2 Carbon: An error has occured while accessing backend services

We have a big issue using WSO2 ESB, which could be a reason to go with another BUS.
Sometimes, without any reason, WSO2 stops working. It is not possible insert anything into it.
Normally you obtain a blank page as result of your try. But if you are lucky, the system could return this:
WSO2 Carbon: An error has occured while accessing backend services.
We have try to install a completely new WSO2 ESB without any relation with our WSO2 ESB. We have try to restart the server who stores it and install every app from the beginning, and it gets the same issue.
However, 2 or 3 days later, it is resolved by itself... no reason...
So we cannot be having this issue every week and wait 2 or 3 days to recover our work.
Any suggestion?
Thanks!
It maybe the issue I mentioned here - WSO2ESB 4.8.1 PassThroughHttpSender does not return thread to worker pool on exception the result of it is exactly the same. ESB stops processing any incoming connection because there are no available "worker" threads.

Is usage of stream between ESB and BAM asynchronous?

I configured a BAM Server Profile and a stream in order to connect one of my Proxy Services to my BAM, I incorrectly configured the IP adress of my BAM.
When I sent a request to my proxy service, the call failed because the BAM server is not reachable. Does this mean that the exhanges between ESB and BAM is not asynchronous and can imply a failure of my proxy service?
Nicolas, every mediator is synchronous in the chain.
If you want to call the BAM asynchronously, what you need to do is:
1) Use the clone mediator to create an asynchronous thread (Sequential Mediation: NO, Continue Parent: YES). http://wso2.org/project/esb/java/4.0.0/docs/mediators/clone.html
2) In the cloned target do all your async work and place the BAM Agent Mediator.
That way you'll have your mediation working not only safer but also with better performance (since all the transformation you may need while preparing the information to be sent to BAM is happening asynchronously).
No. Although BAM mediator is synchronous as it is a mediator, data sending operation to BAM side is done asynchronously. That means if the BAM server is not reachable due to some reason (e.g., incorrect IP, BAM is not available) ESB still works properly without any problem. Only the message dumping to BAM will fail. That means mediation sequence will function properly with the server not found exception but the message logging will not happen.
During the development time of BAM mediator we considered cloning the entire message and send asynchronously to BAM side but we rejected that idea, as memory cloning will take significant time and processing which will slow down the ESB. But still data sending part (Data Bridge) works asynchronously as mentioned above.

WSO2 How to set VFS to a scheduled task

In wso2, VFS running default 5 minutes. I think this is bad for performance. I want VFS running when server is not busy. For example, maybe at 02:00 no body request, then VFS can work. I tried add scheduled task, but it no use. Anyone can tell me how to do this? Thank you very much.
I think your question is related to WSO2 How to set scheduled task? and https://stackoverflow.com/questions/10537190/how-to-vfs-service-exposed-as-a-web-service questions. Seems you want to do the VFS polling on a particular time of the day (scheduled to a non-peak time) or via a web service. But unfortunately I don't think it's possible to plug a CRON expression or a service call to VFS, because of how VFS transport has been implemented. Anyway you can suggest this as a feature request at WSO2 JIRA
What you are suggesting can lead to starvation. If the ESB server is continuously hit with requests, the VFS task will never run. As mentioned in the ESB documentation you can adjust the polling interval by specifying the transport.PollInterval parameter. An example of increasing the polling interval to 30 minutes can look like this in the ESB configuration:
<parameter name="transport.PollInterval">1800000</parameter>