Mule 4 long running httpRequest -http request that connects sap system which takes 10 minutes to give response - mule

in mule 4 have to trigger http request with post to sap system , sap system takes 10 minutes to give response, but DLB only keeps the http request for 5 minutes and after 5 minutes getting http time out error, how to solve this issue pls help me out

You have to change the request to take less than 5 minutes. There is no way around it. Ask for less data or design an API that can process responses asynchronously.
That timeout is to prevent the DLB to run out of resources under load. Even 5 minutes can be too high depending on load.

Related

Logic Apps - HTTP Core - success with 202 status and asynchronous pattern

Here is my LogicApp:
It is calling API which launches process running for 10 minutes, returns 202 and returns location header for status checks and when is done it returns 200. I have asynchronous pattern enabled and time limit set to PT2H in this Logic app. So I expect it to run for about 10 minutes periodically checking status until 200 is received or time out.
However, in overview tab this app shows successful run with duration of 1.09 seconds.
This is a bit counterintuitive. What am I missing?
To check the setup, I updated my API to return status 400 upon completion and my LogicApp is supposed to send email in case of error or time out. API ran fine and returned 400 status, but I did not get an e-mail, so I do nothing polling is happening correct. Any thoughts?
I do repro in my lab after creating a ISE for logic app by using as follows with duration of 5 mins. And after 5 min. received mail as well.
Going to Logic App designer and created with Recurrence Core.
Added scheduler> Delay for the time to hold for http core in delay section as follows:
Then added HTTP core> settings> Asynchronus pattern ON and Timeout set as below:
And set same setting for the send email as well from the setting.
]5
And after that we can save it and run the Logic app . Then We can check the overview as per delay time which i set earlier:
For further information please refer the How Long will aLogic App Continue to check a HTTP 202 Accepted Response and the Doc.

How long is the Error 429 TooManyRequests cooldown?

I accidentally caused my code to send over 4500 requests to the News API and now I am locked out of the API response.
The News API website just tells to back off for a while in their Error documentation, but there is no actual waiting time mentioned. I've already waited over 3 hours.
Is the cooldown specific to the server or are these things universally same?
Do I need to wait to tomorrow (24 hours) ?
There was no Retry-After header as far as I can tell.
OK, I got reply from the API support. 500 requests / 12h => 1k/day.

How to handle hitting same request after every 20sec in loadrunner

I am scripting for an application in which there is a search to be done and when search is hit after entering required parameters the request is sent to the server after 20 sec the request is passes with 200 response code and automatically send same request again every 20sec until actual response is received. Does anyone came across this kind of application. Please let me know.
Thanks

Marketo API - Maximum of 10 concurrent API calls

I'd like to know what Marketo means by 10 concurrent API calls. If for example 20 people use an API in the same time, is it going to crash ? And if I make the script sleep for X seconds if I get that limit response and try the API call again, will it work ?
Thanks,
Best Regards,
Martin
Maximum of 10 concurrent API calls means, that Marketo will process only 10 simultaneous API requests per subscription at maximum.
So, for example if you have a service that directly queries the API every time it is used, and this very service gets called 11 or more times in the same time, than Marketo will respond with an error message for the eleventh call and the rest. The first 10 calls should be processed fine. According to the docs, the error message the following requests will receive will have an error code of 615.
If your script is single threaded (like standard PHP) and you have more that 10 API calls, and your script is running in one instance, than you are fine, since the calls are performed one after another (so they are not concurrent). However, if your script can run in multiple instance you can hit the limit easily. In case a sleep won't help you, but you can always check the response code in your script and retry the call if it received an error. This retry process is often called Exponential Backoff. Here is a great article on this topic.

Long polling Windows Phone, 60 seconds TimeOut

HelloA Windows Phone application need to connect to a server and get messages from it. This is done using WCF and long polling on the server. 3 minutes is the timeout defined on the server. Call from windows phone is done using HttpWebRequest.
The problem is that Windows Phone devices have a timeout of 60 seconds for get request (emulator have a different value, greater than 3 minutes).
Currently i can't decrease server timeout. Doing a new GetRequest after the 60 seconds doesn't get anymore messages.
Does anyone have an idea ?
Thanks
I don't think leaving a connection open is a good idea on mobile devices. I'm assuming that's what you're doing. In my app, I would just poll whenever needed by creating a new HttpWebRequest. But it made sense to do this in my app, because I would be updating train arrival status every 40 seconds.
If you're trying to pull data on a given schedule, put a timer in and just call the webserver every 3 minutes or whatever the requirement is.
If you want to be able to check things (when the app is closed) or if there's rarely fresh data on the server, then you'd need to implement a Push mechanism.
Update: Here's a good article on dealing with the timeout issue - http://blog.xyzzer.me/2011/03/10/real-time-client-server-communication-on-windows-phone-with-long-polling/
Update 2: What if you arranged it so that, you have cascading connections - what I mean is since you can't go beyond 60 seconds per connection, you can write a class that'll house two connections and once one of them is about to timeout, say several seconds before, you can start opening the other connection - you can pick the timing so that there's at most 5 seconds of overlap between them. This way you could have your always open connection.
Also see what these guys have done with the GChat app, they have their source code available at this link. This may provide a more proper design.