| | |
| | | public static final String ACID_MESSAGE_ROUTING_KEY = "huacheng.acid.message.key"; |
| | | public static final String ACID_MESSAGE_EXCHANGE = "huacheng.acid.message.exchange"; |
| | | |
| | | /** |
| | | * 服务商城订单 |
| | | */ |
| | | public static final String SHOP_ORDER_QUEUE="huacheng.shop.order.queue"; |
| | | public static final String SHOP_ORDER_ROUTING_KEY = "huacheng.shop.order.key"; |
| | | public static final String SHOP_ORDER_EXCHANGE = "huacheng.shop.order.exchange"; |
| | | |
| | | @Bean |
| | | public Queue preOrderQueue(){ |
| | | return new Queue(PreOrder_QUEUE,true,false,false,null); |
| | |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | public Queue shopOrderQueue(){ |
| | | return new Queue(SHOP_ORDER_QUEUE,true,false,false,null); |
| | | } |
| | | |
| | | @Bean |
| | | public Exchange shopOrderExchange(){ |
| | | Map<String, Object> arguments = new HashMap<>(); |
| | | arguments.put("x-delayed-type", ExchangeTypes.DIRECT); |
| | | return new CustomExchange(SHOP_ORDER_EXCHANGE,"x-delayed-message",true,false,arguments); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding shopOrderBinding(){ |
| | | return BindingBuilder.bind(shopOrderQueue()).to(shopOrderExchange()).with(SHOP_ORDER_ROUTING_KEY).noargs(); |
| | | } |
| | | } |
| | | |