|
@@ -79,17 +79,16 @@ public class MessageConsumer {
|
|
|
* 则会出现重复消费数据的情况
|
|
* 则会出现重复消费数据的情况
|
|
|
*/
|
|
*/
|
|
|
public void waitResponse(String batchCode) {
|
|
public void waitResponse(String batchCode) {
|
|
|
- logger.info("waiting batchCode: " + batchCode);
|
|
|
|
|
subscribe();
|
|
subscribe();
|
|
|
while (true) {
|
|
while (true) {
|
|
|
|
|
+ logger.info("waiting batchCode: " + batchCode);
|
|
|
if (batchCodes.contains(batchCode)) {
|
|
if (batchCodes.contains(batchCode)) {
|
|
|
logger.info("waited batchCode: " + batchCode);
|
|
logger.info("waited batchCode: " + batchCode);
|
|
|
batchCodes.remove(batchCode);
|
|
batchCodes.remove(batchCode);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
|
- logger.info("sleep 1s...");
|
|
|
|
|
- Thread.sleep(1000);
|
|
|
|
|
|
|
+ Thread.sleep(500);
|
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
|
logger.error("sleep error", e);
|
|
logger.error("sleep error", e);
|
|
|
}
|
|
}
|