package com.buy507.mall.component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 分销预结算消息的处理者
 */
@Component
@RabbitListener(queues = "mall.distribute.compute")
public class DistributeReceiver {
	
    private static Logger LOGGER = LoggerFactory.getLogger(DistributeReceiver.class);
    
    @RabbitHandler
    public void handle(Long orderId){
    	LOGGER.info("Distribute receive orderId:{}", orderId);
    	DistributeHandlerQueue.addOrderToQueue(orderId);
    }
}
