[SQL Component] Improve handling when there is no connection
Currently on database insert it seems that it will continuously try to finish the SQL statement. This leads to 100% CPU.
- Investigate first what happens when there is no database available.
- Investigate what are possibilities of the component to handle such cases.
Here are the preliminary findings:
-
The SQL Component is a custom component (probably forked from an older Camel branch)
-
Every query follows the following pattern:
a. Connect to the database b. Check connection c. Execute the query
When step b is false you should see the following statement:
Could not connect to the database, check your settings.
So the SQL Query (step C) is never executed, and it should not lead to high CPU.
There maybe two reason why there is still high CPU load and that maybe:
-
In step A a driver is registered. In Karaf we had also problem with registering multiple drivers we lead to high CPU (or memory?). This fix wasn't applied to Assimbly. I requested Bruno to also apply it here just to make sure.
-
The other option would be that it was still possible to connect (step b is true), but the execution of the SQL is still being done.
In the future I would like to use the standard SQL component as this probably is better performance out-of-the-box.