From ec91d24c17de360d7eefb849a76d14dcb52cb118 Mon Sep 17 00:00:00 2001 From: Administrator Date: Mon, 1 May 2023 22:20:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81=E7=9A=84?= =?UTF-8?q?=E5=BB=B6=E8=BF=9F=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mashibing/config/RabbitTemplateConfig.java | 1 + .../java/com/mashibing/controller/PlaceOrderController.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/01-placeorder/src/main/java/com/mashibing/config/RabbitTemplateConfig.java b/01-placeorder/src/main/java/com/mashibing/config/RabbitTemplateConfig.java index 4f17a6d..a4bfdc6 100644 --- a/01-placeorder/src/main/java/com/mashibing/config/RabbitTemplateConfig.java +++ b/01-placeorder/src/main/java/com/mashibing/config/RabbitTemplateConfig.java @@ -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){ diff --git a/01-placeorder/src/main/java/com/mashibing/controller/PlaceOrderController.java b/01-placeorder/src/main/java/com/mashibing/controller/PlaceOrderController.java index 0b6728c..e1744e0 100644 --- a/01-placeorder/src/main/java/com/mashibing/controller/PlaceOrderController.java +++ b/01-placeorder/src/main/java/com/mashibing/controller/PlaceOrderController.java @@ -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标识