|
|
@@ -30,6 +30,7 @@ public class MessageConsumer {
|
|
|
private static final List<String> topics = Collections.singletonList("RESPONSE");
|
|
|
|
|
|
private static final String LOG_DIR = System.getProperty("java.io.tmpdir");
|
|
|
+ private static final String LOG_FILE_PATH = (LOG_DIR.endsWith(File.separator) ? LOG_DIR : LOG_DIR + "/") + "batch-code-timeout.log";
|
|
|
|
|
|
/**
|
|
|
* 等待的最大次数
|
|
|
@@ -104,8 +105,7 @@ public class MessageConsumer {
|
|
|
}
|
|
|
}
|
|
|
// 超过最大次数后,记录 batchCode
|
|
|
- String logFilePath = (LOG_DIR.endsWith(File.separator) ? LOG_DIR : LOG_DIR + "/") + "batch-code-timeout.log";
|
|
|
- try (FileWriter fileWriter = new FileWriter(logFilePath, true)) {
|
|
|
+ try (FileWriter fileWriter = new FileWriter(LOG_FILE_PATH, true)) {
|
|
|
fileWriter.write(DateFormatUtils.DATETIME_FORMAT.format(new Date()) + " " + batchCode + "\n");
|
|
|
fileWriter.flush();
|
|
|
} catch (IOException e) {
|