优化es索引更新,把单次更新优化为批量更新

This commit is contained in:
paulGao
2021-12-30 16:59:45 +08:00
parent 74e5e86eff
commit 194d0b6ac2
3 changed files with 73 additions and 41 deletions

View File

@@ -144,7 +144,6 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
break;
case DELETE_GOODS_INDEX_PROMOTIONS:
BasePromotions promotions = JSONUtil.toBean(new String(messageExt.getBody()), BasePromotions.class);
log.info("删除索引信息: {}", promotions);
if (CharSequenceUtil.isNotEmpty(promotions.getScopeId())) {
this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(Arrays.asList(promotions.getScopeId().split(",")), promotions.getId());
} else {
@@ -264,7 +263,7 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
this.goodsIndexService.updateEsGoodsIndexAllByList(promotions, esPromotionKey);
}
} catch (Exception e) {
log.error("生成商品索引促销信息执行异常",e);
log.error("生成商品索引促销信息执行异常", e);
}
}