package com.buy507.mall.portal.component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 分销预结算消息的发出者
 */
@Component
public class DistributeSender {
	
    private static Logger LOGGER = LoggerFactory.getLogger(DistributeSender.class);
    
    @Autowired
    private AmqpTemplate amqpTemplate;

    public void sendMessage(Long orderId){
    	amqpTemplate.convertAndSend("mall.distribute.compute", orderId);
        LOGGER.info("Distribute send orderId:{}", orderId);
    }
}
