Isranis
Isranis

Reputation: 103

Connection timeout in http requester in mule

I hitting multiple url in http requestor in mulesoft

     For example:-abc.com
                  def.com
                  ghy.com
                  xyz.com

But in "def.com" I am getting connection time out error(no response code is coming) and i know because site is down but once i got this error my flow got stopped and not going forward for another website i.e "ghy.com" etc..

Can you please tell me how to make flow in continue processing even i got connection time out for particular website

I have tried catch exception strategy but i caught this exception but not able the proceed the flow.

Upvotes: 1

Views: 2242

Answers (1)

Avanaur
Avanaur

Reputation: 475

Do the following.

  1. Put "def.com" HTTP request component in a private flow.
  2. Add a "catch exception strategy" on that private flow
  3. Add a flow reference from original flow to private flow.

The catch exception should handle the error on private flow, and when it returns to original flow (calling flow), it should continue processing.

EDIT

Here's what I mean. test2Flow is the main flow, then you got foreach component somewhere there. It will call a private flow.

The private flow does the HTTP request call where the URL comes from payload. It has catch exception strategy to handle errors from this HTTP request.

Here, foreach loop should not stop when error occurred inside the private flow.

<http:request-config name="HTTP_Request_Configuration" host="#[payload.url]" port="#[payload.port]" doc:name="HTTP Request Configuration"/>
<flow name="test2Flow">
    <!--get list -->
    <foreach doc:name="For Each">
        <flow-ref name="payload" doc:name="Flow Reference"/>
    </foreach>
</flow>
<flow name="test2Flow1">
    <http:request config-ref="HTTP_Request_Configuration" path="/" method="GET" doc:name="HTTP"/>
    <!-- store response -->
    <catch-exception-strategy doc:name="Catch Exception Strategy">
        <logger level="INFO" doc:name="Logger"/>
    </catch-exception-strategy>
</flow>

Upvotes: 1

Related Questions