实现异步调用(用户积分&商家服务消费消息)

master
Administrator 3 years ago
parent 34b92f0411
commit becd6e50d8

@ -15,7 +15,7 @@ import java.io.IOException;
@Component
public class UserPointsListener {
@RabbitListener(queues = {RabbitMQConfig.COUPON_QUEUE})
@RabbitListener(queues = {RabbitMQConfig.USER_POINTS_QUEUE})
public void consume(String msg, Channel channel, Message message) throws InterruptedException, IOException {
// 预扣除用户积分
Thread.sleep(400);

@ -15,7 +15,7 @@ import java.io.IOException;
@Component
public class BusinessListener {
@RabbitListener(queues = {RabbitMQConfig.COUPON_QUEUE})
@RabbitListener(queues = {RabbitMQConfig.BUSINESS_QUEUE})
public void consume(String msg, Channel channel, Message message) throws InterruptedException, IOException {
// 通知商家成功!
Thread.sleep(400);

Loading…
Cancel
Save