refactor(rabbit): 更新队列名称和配置
- 修改 AgentConsumer 中的队列名称
- 更新 QueueConstants 中的队列常量
- 调整 RabbitQueueEnum 中的队列枚举值
| | |
| | | **/ |
| | | public class QueueConstants { |
| | | |
| | | public static final String QUEUE_DEFAULT = "queue_default_qay"; |
| | | public static final String AGENT_AUTO_LEVEL_UP = "queue_agent_auto_level_up_qay"; |
| | | public static final String AGENT_RETURN_MONEY = "queue_agent_return_money_qay"; |
| | | public static final String ORDER_RETURN_MONEY = "queue_order_return_money_qay"; |
| | | public static final String QUEUE_DEFAULT = "queue_default_qay_xcx"; |
| | | public static final String AGENT_AUTO_LEVEL_UP = "queue_agent_auto_level_up_qay_xcx"; |
| | | public static final String AGENT_RETURN_MONEY = "queue_agent_return_money_qay_xcx"; |
| | | public static final String ORDER_RETURN_MONEY = "queue_order_return_money_qay_xcx"; |
| | | |
| | | public static final String ORDER_COUPON = "queue_order_coupon"; |
| | | public static final String ORDER_COUPON = "queue_order_coupon_xcx"; |
| | | |
| | | public static final String GET_SCORE_MSG = "queue_get_score_msg"; |
| | | public static final String VIP_LEVEL_UP = "queue_vip_level_up"; |
| | | public static final String GET_SCORE_MSG = "queue_get_score_msg_xcx"; |
| | | public static final String VIP_LEVEL_UP = "queue_vip_level_up_xcx"; |
| | | } |
| | |
| | | import cc.mrbird.febs.mall.service.IApiMallOrderInfoService; |
| | | import cc.mrbird.febs.mall.service.IMemberProfitService; |
| | | import cc.mrbird.febs.rabbit.constants.QueueConstants; |
| | | import cc.mrbird.febs.rabbit.enumerates.RabbitQueueEnum; |
| | | import cc.mrbird.febs.vip.service.IVipCommonService; |
| | | import com.rabbitmq.client.Channel; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | log.info("消费者:{}", new String(message.getBody())); |
| | | } |
| | | |
| | | @RabbitListener(queues = "queue_order_delay_qay") |
| | | @RabbitListener(queues = "queue_order_delay_qay_xcx") |
| | | public void orderCancelDelay(String id) { |
| | | try { |
| | | orderInfoService.autoCancelOrder(Long.parseLong(id)); |
| | |
| | | @Getter |
| | | public enum RabbitQueueEnum { |
| | | |
| | | DEFAULT("exchange_default_qay", "route_key_default_qay", "queue_default_qay"), |
| | | DEFAULT("exchange_default_qay", "route_key_default_qay", "queue_default_qay_xcx"), |
| | | |
| | | ORDER_CANCEL_DELAY_TTL("exchange_order_delay_ttl_qay", "route_key_order_delay_ttl_qay", "queue_order_delay_ttl_qay"), |
| | | ORDER_CANCEL_DELAY("exchange_order_delay_qay", "route_key_order_delay_qay", "queue_order_delay_qay"), |
| | | ORDER_CANCEL_DELAY_TTL("exchange_order_delay_ttl_qay_xcx", "route_key_order_delay_ttl_qay_xcx", "queue_order_delay_ttl_qay_xcx"), |
| | | ORDER_CANCEL_DELAY("exchange_order_delay_qay_xcx", "route_key_order_delay_qay_xcx", "queue_order_delay_qay_xcx"), |
| | | |
| | | AGENT_REUTRN_MONEY("exchange_agent_return_money_qay", "route_key_agent_return_money_qay", "queue_agent_return_money_qay"), |
| | | AGENT_REUTRN_MONEY("exchange_agent_return_money_qay_xcx", "route_key_agent_return_money_qay_xcx", "queue_agent_return_money_qay_xcx"), |
| | | |
| | | ORDER_RETURN_MONEY("exchange_order_return_money_qay", "route_key_order_return_money_qay", "queue_order_return_money_qay"), |
| | | ORDER_RETURN_MONEY("exchange_order_return_money_qay_xcx", "route_key_order_return_money_qay_xcx", "queue_order_return_money_qay_xcx"), |
| | | |
| | | ORDER_COUPON("exchange_order_coupon", "route_key_order_coupon", QueueConstants.ORDER_COUPON), |
| | | ORDER_COUPON("exchange_order_coupon_xcx", "route_key_order_coupon_xcx", QueueConstants.ORDER_COUPON), |
| | | |
| | | GET_SCORE_MSG("exchange_get_score_msg", "route_key_get_score_msg", QueueConstants.GET_SCORE_MSG), |
| | | GET_SCORE_MSG("exchange_get_score_msg_xcx", "route_key_get_score_msg_xcx", QueueConstants.GET_SCORE_MSG), |
| | | |
| | | VIP_LEVEL_UP("exchange_vip_level_up", "route_key_vip_level_up", QueueConstants.VIP_LEVEL_UP); |
| | | VIP_LEVEL_UP("exchange_vip_level_up_xcx", "route_key_vip_level_up_xcx", QueueConstants.VIP_LEVEL_UP); |
| | | |
| | | private String exchange; |
| | | |