记得上下班打卡 | git大法好,push需谨慎

Commit 3b4771c8 authored by zhanggb's avatar zhanggb

~que:GoblinQueue.BIZ_ARTWORK_UPL:重新入队调整;

parent 0f1f5550
......@@ -58,11 +58,12 @@ public class ConsumerGoblinBizArtworkUplReceiver extends AbstractBizRedisReceive
try {
postDataMap.add("skuId", skuId);
String postRespStr = HttpUtil.post(postUrl, postDataMap);
JsonNode postRespJNode = JsonUtils.fromJson(postRespStr, JsonNode.class), postRespCode;
if (null == postRespJNode || null == (postRespCode = postRespJNode.get("code")) || !postRespCode.asText().equals("0")) {
log.warn("#NFT素材上传:处理失败[paramsStr={},postRespStr={}]", postDataMap, postRespStr);
return false;
}
// 失败重新入队逻辑改至`被调用API`实现
// JsonNode postRespJNode = JsonUtils.fromJson(postRespStr, JsonNode.class), postRespCode;
// if (null == postRespJNode || null == (postRespCode = postRespJNode.get("code")) || !postRespCode.asText().equals("0")) {
// log.warn("#NFT素材上传:处理失败[paramsStr={},postRespStr={}]", postDataMap, postRespStr);
// return false;
// }
return true;
} catch (Exception e) {
log.error("Ex.NFT素材上传:处理异常[url={},paramsStr={}],ex:{}", postUrl, postDataMap, e.getMessage());
......
......@@ -15,6 +15,7 @@ import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.QueueUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -35,6 +36,8 @@ import java.util.LinkedList;
@Slf4j
@Service
public class GoblinQueBizArtworkUplService {
@Autowired
QueueUtils queueUtils;
@Autowired
GoblinRedisUtils goblinRedisUtils;
@Autowired
......@@ -50,6 +53,7 @@ public class GoblinQueBizArtworkUplService {
private static final String SQL_UPDATE_GOODS_SKU_NFT = "UPDATE goblin_goods_sku_nft SET upchain=?,display_url=?,nft_url=? WHERE sku_id=? AND upchain=0 ";
public ResponseDto<String> bizArtworkUplProcessing(String skuId) {
try {
GoblinGoodsSkuInfoVo mgtGoodsSkuInfoVo = goblinMongoUtils.getGoodsSkuInfoVo(skuId);
if (null == mgtGoodsSkuInfoVo) {
log.warn("#NFT素材上传:藏品SKU不存在[skuId={}]", skuId);
......@@ -73,6 +77,8 @@ public class GoblinQueBizArtworkUplService {
galaxyNftUploadReqDto.setRouterType(mgtGoodsSkuInfoVo.getRouteType());
GalaxyNftUploadRespDto galaxyNftUploadRespDto = this.uploadNftMaterial(galaxyNftUploadReqDto);
if (null == galaxyNftUploadRespDto) {
log.warn("#NFT素材上传:处理失败[skuId={}]", skuId);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.BIZ_ARTWORK_UPL.getKey(), skuId);
return ResponseDto.failure(String.format("藏品上传失败[skuId:%s]", skuId));// 上传失败,重新入队处理
}
......@@ -119,6 +125,11 @@ public class GoblinQueBizArtworkUplService {
HashMap<String, String> toQueueBeClaimQueryMsg = CollectionUtil.mapStringString();
toQueueBeClaimQueryMsg.put(MQConst.QUEUE_MESSAGE_KEY, skuId.concat(",").concat(String.valueOf(LocalDateTime.now())));
streamOperations.add(StreamRecords.mapBacked(toQueueBeClaimQueryMsg).withStreamKey(MQConst.GoblinQueue.BIZ_ARTWORK_CLQ.getKey()));
} catch (Exception e) {
log.error("Ex.NFT素材上传:处理异常[skuId={}]", skuId, e);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.BIZ_ARTWORK_UPL.getKey(), skuId);
return ResponseDto.failure(String.format("藏品上传异常[skuId:%s]", skuId));
}
return ResponseDto.success();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment