2
votes

I Have my wso2 APIM (all-in-one deployment), that need to send and consumes info for my Analytics (wso2 Stream Processor). The integration goes well in the first day. Normally in the second day my Analytics starts to give me the follow db connection error:

ERROR {org.wso2.extension.siddhi.io.mgwfile.task.MGWFileReaderTask} - Error occurred while publishing micro-gateway API Usage data. org.wso2.extension.siddhi.io.mgwfile.exception.MGWFileSourceException: Error occurred while getting the next files to process.
        at org.wso2.extension.siddhi.io.mgwfile.dao.MGWFileSourceDAO.getNextFilesToProcess(MGWFileSourceDAO.java:148)
        at org.wso2.extension.siddhi.io.mgwfile.task.MGWFileReaderTask.run(MGWFileReaderTask.java:59)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
Caused by: java.sql.SQLTransientConnectionException: HikariPool-5 - Connection is not available, request timed out after 30258ms.
        at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:213)
        at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:163)
        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:85)
        at org.wso2.extension.siddhi.io.mgwfile.util.MGWFileSourceDBUtil.getConnection(MGWFileSourceDBUtil.java:47)
        at org.wso2.extension.siddhi.io.mgwfile.dao.MGWFileSourceDAO.getNextFilesToProcess(MGWFileSourceDAO.java:107)
        ... 3 more

It´s looks like this Hikari don´t clear the db sessions how to proceed to avoid the db connection of my analytics stay health?

2
Were you able to solve this? I have a similar problem.DaviesTobi alex

2 Answers

1
votes

This issue also could be due to the lack of more DB connection. For that, you can try to increase the max pool size in the data source configuration APIM_ANALYTICS_DB. ex:

    maxPoolSize: 100

Also, make sure DB is supported max connection defined in the maxPoolSize. If not increase it in the DB too.