订单状态的延迟处理

master
Administrator 2 years ago
parent 7d1e03540a
commit ec91d24c17

@ -44,6 +44,7 @@ public class RabbitTemplateConfig {
return new RabbitTemplate.ConfirmCallback(){
@Override
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
System.out.println("confirm:" + Thread.currentThread().getName());
if (correlationData == null) return;
String msgId = correlationData.getId();
if(ack){

@ -37,10 +37,10 @@ public class PlaceOrderController {
public String po(){
long start = System.currentTimeMillis();
//1、调用库存服务扣除商品库存
itemStockClient.decr();
// itemStockClient.decr();
//2、调用订单服务创建订单
orderManageClient.create();
// orderManageClient.create();
System.out.println(Thread.currentThread().getName());
// 将之前的同步方式注释
String userAndOrderInfo = "用户信息&订单信息&优惠券信息等等…………";
// 声明当前消息的id标识

Loading…
Cancel
Save