Adds the Maven coordinate to TimeoutException catch.
@@ -84,13 +84,14 @@ public class OPALPlugin extends Plugin {
processedRecord = false;
JSONObject kafkaConsumedJson = new JSONObject(kafkaRecord.value());
-
MavenCoordinate mavenCoordinate = new MavenCoordinate(kafkaConsumedJson.get("groupId").toString(),
kafkaConsumedJson.get("artifactId").toString(),
kafkaConsumedJson.get("version").toString());
logger.info("Generating RevisionCallGraph for {} ...", mavenCoordinate.getCoordinate());
+ try {
+
ExecutorService OPALExecutor = Executors.newSingleThreadExecutor();
OPALExecutor.submit(() -> {
lastCallGraphGenerated = PartialCallGraph.createExtendedRevisionCallGraph("mvn",
@@ -122,16 +123,16 @@ public class OPALPlugin extends Plugin {
}
} catch (NullPointerException e){
- logger.error("Null pointer. It might be not having Kafka producer due to test purposes. {}", e.getStackTrace());
- }
- catch (JSONException e) {
- logger.error("An exception occurred while using consumer records as json: {}", e.getStackTrace());
+ logger.error("Null pointer. It might not have a Kafka producer due to test purposes. {}", e.getStackTrace());
} catch (TimeoutException e){
- logger.info("Exceeded allowed time for generation of the call graph");
+ logger.info("Exceeded allowed time for generation of the call graph: {}", mavenCoordinate.getCoordinate());
} catch (Exception e) {
logger.error("", e.getStackTrace());
e.printStackTrace();
}
+ } catch (JSONException e){
+ logger.error("Couldn't parse the record as JSON: {}\n{}", kafkaRecord.value(), e.getStackTrace());
+ }
}
@Override
