0
votes

I am persistently getting the following error when my API tries to connect to the database:


Message : Error sending HTTP request. Message payload is of type: String Type : org.mule.api.MessagingException Code : MULE_ERROR--2 JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html


Exception stack is: 1. Timeout exceeded (java.util.concurrent.TimeoutException) com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider:426 (null) 2. Error sending HTTP request. Message payload is of type: String (org.mule.api.MessagingException) org.mule.module.http.internal.request.DefaultHttpRequester:287 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)


Root Exception stack trace: java.util.concurrent.TimeoutException: Timeout exceeded at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider.timeout(GrizzlyAsyncHttpProvider.java:426) at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$3.onTimeout(GrizzlyAsyncHttpProvider.java:274) at org.glassfish.grizzly.utils.IdleTimeoutFilter$DefaultWorker.doWork(IdleTimeoutFilter.java:398) at org.glassfish.grizzly.utils.IdleTimeoutFilter$DefaultWorker.doWork(IdleTimeoutFilter.java:377) at org.glassfish.grizzly.utils.DelayedExecutor$DelayedRunnable.run(DelayedExecutor.java:158) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

My API is trying to connect to a database as follows:

   <flow name="system-api-config"  >
    <set-property propertyName="Content-Type" value="application/json" doc:name="Set Content Type"/>


    <json:json-to-object-transformer returnClass="java.lang.Object" doc:name="JSON to Object"/>

   <!--  <set-variable variableName="agreementLinePayload" value="#[new java.util.ArrayList()]" doc:name="Set Entries"/> -->
    <set-variable variableName="agPayload" value="#[new java.util.HashMap()]" doc:name="Set Entries"/>
    <set-variable variableName="agLnID" value="#[payload.agLnID]" "/>
    <set-variable variableName="exe" value="#[payload.exe]" "/>
    <logger message="Extended Price :#[flowVars.extendedPrice]" level="INFO" doc:name="Logger"/>

          <expression-component doc:name="Expression"><![CDATA[
           flowVars.agreementLinePayload.add(payload.agLnID);
           flowVars.agreementLinePayload.add(payload.exe);

     ]]> 
    </expression-component>


     <db:bulk-execute config-ref="Oracle_Configuration" doc:name="Database"><![CDATA[INSERT INTO HDR(ID,      
                                                                                someNUMBER,
                                                                                START_DATE,  
                                                                                END_DATE,
                                                                                O_NUMBER)
                                                                                VALUES (SEQ.NEXTVAL,                                                            
                                                                                        NUM_SEQ.NEXTVAL,                                                                                          
                                                                                        TO_DATE('2017-02-17','YYYY-MM-DD HH24:MI:SS'),      
                                                                                        TO_DATE('2018-02-17','YYYY-MM-DD HH24:MI:SS'),
                                                                                        #[payload.myField])


     </db:bulk-execute>

….

I have tried toggling connection timeout & HTTP Request timeout but to no avail. it always gives this timeout exception when I make the database call, please give ideas.

1

1 Answers

0
votes

Have you tried executing the sql query in database? It could be the query took a long time to process.