com.macro.mall.portal.domain.QueueEnum Java Examples

The following examples show how to use com.macro.mall.portal.domain.QueueEnum. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RabbitMqConfig.java    From mall with Apache License 2.0 5 votes vote down vote up
/**
 * 订单消息实际消费队列所绑定的交换机
 */
@Bean
DirectExchange orderDirect() {
    return (DirectExchange) ExchangeBuilder
            .directExchange(QueueEnum.QUEUE_ORDER_CANCEL.getExchange())
            .durable(true)
            .build();
}
 
Example #2
Source File: CancelOrderSender.java    From macrozheng-mall with MIT License 5 votes vote down vote up
public void sendMessage(Long orderId,final long delayTimes){
    //给延迟队列发送消息
    amqpTemplate.convertAndSend(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getExchange(), QueueEnum.QUEUE_TTL_ORDER_CANCEL.getRouteKey(), orderId, new MessagePostProcessor() {
        @Override
        public Message postProcessMessage(Message message) throws AmqpException {
            //给消息设置延迟毫秒值
            message.getMessageProperties().setExpiration(String.valueOf(delayTimes));
            return message;
        }
    });
    LOGGER.info("send orderId:{}",orderId);
}
 
Example #3
Source File: RabbitMqConfig.java    From macrozheng-mall with MIT License 5 votes vote down vote up
/**
 * 将订单延迟队列绑定到交换机
 */
@Bean
Binding orderTtlBinding(DirectExchange orderTtlDirect,Queue orderTtlQueue){
    return BindingBuilder
            .bind(orderTtlQueue)
            .to(orderTtlDirect)
            .with(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getRouteKey());
}
 
Example #4
Source File: RabbitMqConfig.java    From macrozheng-mall with MIT License 5 votes vote down vote up
/**
 * 将订单队列绑定到交换机
 */
@Bean
Binding orderBinding(DirectExchange orderDirect,Queue orderQueue){
    return BindingBuilder
            .bind(orderQueue)
            .to(orderDirect)
            .with(QueueEnum.QUEUE_ORDER_CANCEL.getRouteKey());
}
 
Example #5
Source File: RabbitMqConfig.java    From macrozheng-mall with MIT License 5 votes vote down vote up
/**
 * 订单延迟队列(死信队列)
 */
@Bean
public Queue orderTtlQueue() {
    return QueueBuilder
            .durable(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getName())
            .withArgument("x-dead-letter-exchange", QueueEnum.QUEUE_ORDER_CANCEL.getExchange())//到期后转发的交换机
            .withArgument("x-dead-letter-routing-key", QueueEnum.QUEUE_ORDER_CANCEL.getRouteKey())//到期后转发的路由键
            .build();
}
 
Example #6
Source File: RabbitMqConfig.java    From macrozheng-mall with MIT License 5 votes vote down vote up
/**
 * 订单延迟队列队列所绑定的交换机
 */
@Bean
DirectExchange orderTtlDirect() {
    return (DirectExchange) ExchangeBuilder
            .directExchange(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getExchange())
            .durable(true)
            .build();
}
 
Example #7
Source File: RabbitMqConfig.java    From macrozheng-mall with MIT License 5 votes vote down vote up
/**
 * 订单消息实际消费队列所绑定的交换机
 */
@Bean
DirectExchange orderDirect() {
    return (DirectExchange) ExchangeBuilder
            .directExchange(QueueEnum.QUEUE_ORDER_CANCEL.getExchange())
            .durable(true)
            .build();
}
 
Example #8
Source File: CancelOrderSender.java    From mall with Apache License 2.0 5 votes vote down vote up
public void sendMessage(Long orderId,final long delayTimes){
    //给延迟队列发送消息
    amqpTemplate.convertAndSend(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getExchange(), QueueEnum.QUEUE_TTL_ORDER_CANCEL.getRouteKey(), orderId, new MessagePostProcessor() {
        @Override
        public Message postProcessMessage(Message message) throws AmqpException {
            //给消息设置延迟毫秒值
            message.getMessageProperties().setExpiration(String.valueOf(delayTimes));
            return message;
        }
    });
    LOGGER.info("send orderId:{}",orderId);
}
 
Example #9
Source File: RabbitMqConfig.java    From mall with Apache License 2.0 5 votes vote down vote up
/**
 * 将订单延迟队列绑定到交换机
 */
@Bean
Binding orderTtlBinding(DirectExchange orderTtlDirect,Queue orderTtlQueue){
    return BindingBuilder
            .bind(orderTtlQueue)
            .to(orderTtlDirect)
            .with(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getRouteKey());
}
 
Example #10
Source File: RabbitMqConfig.java    From mall with Apache License 2.0 5 votes vote down vote up
/**
 * 将订单队列绑定到交换机
 */
@Bean
Binding orderBinding(DirectExchange orderDirect,Queue orderQueue){
    return BindingBuilder
            .bind(orderQueue)
            .to(orderDirect)
            .with(QueueEnum.QUEUE_ORDER_CANCEL.getRouteKey());
}
 
Example #11
Source File: RabbitMqConfig.java    From mall with Apache License 2.0 5 votes vote down vote up
/**
 * 订单延迟队列(死信队列)
 */
@Bean
public Queue orderTtlQueue() {
    return QueueBuilder
            .durable(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getName())
            .withArgument("x-dead-letter-exchange", QueueEnum.QUEUE_ORDER_CANCEL.getExchange())//到期后转发的交换机
            .withArgument("x-dead-letter-routing-key", QueueEnum.QUEUE_ORDER_CANCEL.getRouteKey())//到期后转发的路由键
            .build();
}
 
Example #12
Source File: RabbitMqConfig.java    From mall with Apache License 2.0 5 votes vote down vote up
/**
 * 订单延迟队列队列所绑定的交换机
 */
@Bean
DirectExchange orderTtlDirect() {
    return (DirectExchange) ExchangeBuilder
            .directExchange(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getExchange())
            .durable(true)
            .build();
}
 
Example #13
Source File: RabbitMqConfig.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
/**
 * 订单消息实际消费队列所绑定的交换机
 */
@Bean
DirectExchange orderDirect() {
    return (DirectExchange) ExchangeBuilder
            .directExchange(QueueEnum.QUEUE_ORDER_CANCEL.getExchange())
            .durable(true)
            .build();
}
 
Example #14
Source File: CancelOrderSender.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
public void sendMessage(Long orderId,final long delayTimes){
    //给延迟队列发送消息
    amqpTemplate.convertAndSend(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getExchange(), QueueEnum.QUEUE_TTL_ORDER_CANCEL.getRouteKey(), orderId, new MessagePostProcessor() {
        @Override
        public Message postProcessMessage(Message message) throws AmqpException {
            //给消息设置延迟毫秒值
            message.getMessageProperties().setExpiration(String.valueOf(delayTimes));
            return message;
        }
    });
    LOGGER.info("send orderId:{}",orderId);
}
 
Example #15
Source File: RabbitMqConfig.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
/**
 * 将订单延迟队列绑定到交换机
 */
@Bean
Binding orderTtlBinding(DirectExchange orderTtlDirect,Queue orderTtlQueue){
    return BindingBuilder
            .bind(orderTtlQueue)
            .to(orderTtlDirect)
            .with(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getRouteKey());
}
 
Example #16
Source File: RabbitMqConfig.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
/**
 * 将订单队列绑定到交换机
 */
@Bean
Binding orderBinding(DirectExchange orderDirect,Queue orderQueue){
    return BindingBuilder
            .bind(orderQueue)
            .to(orderDirect)
            .with(QueueEnum.QUEUE_ORDER_CANCEL.getRouteKey());
}
 
Example #17
Source File: RabbitMqConfig.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
/**
 * 订单延迟队列(死信队列)
 */
@Bean
public Queue orderTtlQueue() {
    return QueueBuilder
            .durable(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getName())
            .withArgument("x-dead-letter-exchange", QueueEnum.QUEUE_ORDER_CANCEL.getExchange())//到期后转发的交换机
            .withArgument("x-dead-letter-routing-key", QueueEnum.QUEUE_ORDER_CANCEL.getRouteKey())//到期后转发的路由键
            .build();
}
 
Example #18
Source File: RabbitMqConfig.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
/**
 * 订单延迟队列队列所绑定的交换机
 */
@Bean
DirectExchange orderTtlDirect() {
    return (DirectExchange) ExchangeBuilder
            .directExchange(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getExchange())
            .durable(true)
            .build();
}
 
Example #19
Source File: RabbitMqConfig.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
/**
 * 订单消息实际消费队列所绑定的交换机
 */
@Bean
DirectExchange orderDirect() {
    return (DirectExchange) ExchangeBuilder
            .directExchange(QueueEnum.QUEUE_ORDER_CANCEL.getExchange())
            .durable(true)
            .build();
}
 
Example #20
Source File: CancelOrderSender.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
public void sendMessage(Long orderId,final long delayTimes){
    //给延迟队列发送消息
    amqpTemplate.convertAndSend(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getExchange(), QueueEnum.QUEUE_TTL_ORDER_CANCEL.getRouteKey(), orderId, new MessagePostProcessor() {
        @Override
        public Message postProcessMessage(Message message) throws AmqpException {
            //给消息设置延迟毫秒值
            message.getMessageProperties().setExpiration(String.valueOf(delayTimes));
            return message;
        }
    });
    LOGGER.info("send orderId:{}",orderId);
}
 
Example #21
Source File: RabbitMqConfig.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
/**
 * 将订单延迟队列绑定到交换机
 */
@Bean
Binding orderTtlBinding(DirectExchange orderTtlDirect,Queue orderTtlQueue){
    return BindingBuilder
            .bind(orderTtlQueue)
            .to(orderTtlDirect)
            .with(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getRouteKey());
}
 
Example #22
Source File: RabbitMqConfig.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
/**
 * 将订单队列绑定到交换机
 */
@Bean
Binding orderBinding(DirectExchange orderDirect,Queue orderQueue){
    return BindingBuilder
            .bind(orderQueue)
            .to(orderDirect)
            .with(QueueEnum.QUEUE_ORDER_CANCEL.getRouteKey());
}
 
Example #23
Source File: RabbitMqConfig.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
/**
 * 订单延迟队列(死信队列)
 */
@Bean
public Queue orderTtlQueue() {
    return QueueBuilder
            .durable(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getName())
            .withArgument("x-dead-letter-exchange", QueueEnum.QUEUE_ORDER_CANCEL.getExchange())//到期后转发的交换机
            .withArgument("x-dead-letter-routing-key", QueueEnum.QUEUE_ORDER_CANCEL.getRouteKey())//到期后转发的路由键
            .build();
}
 
Example #24
Source File: RabbitMqConfig.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
/**
 * 订单延迟队列队列所绑定的交换机
 */
@Bean
DirectExchange orderTtlDirect() {
    return (DirectExchange) ExchangeBuilder
            .directExchange(QueueEnum.QUEUE_TTL_ORDER_CANCEL.getExchange())
            .durable(true)
            .build();
}
 
Example #25
Source File: RabbitMqConfig.java    From mall with Apache License 2.0 4 votes vote down vote up
/**
 * 订单实际消费队列
 */
@Bean
public Queue orderQueue() {
    return new Queue(QueueEnum.QUEUE_ORDER_CANCEL.getName());
}
 
Example #26
Source File: RabbitMqConfig.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
/**
 * 订单实际消费队列
 */
@Bean
public Queue orderQueue() {
    return new Queue(QueueEnum.QUEUE_ORDER_CANCEL.getName());
}
 
Example #27
Source File: RabbitMqConfig.java    From macrozheng-mall with MIT License 4 votes vote down vote up
/**
 * 订单实际消费队列
 */
@Bean
public Queue orderQueue() {
    return new Queue(QueueEnum.QUEUE_ORDER_CANCEL.getName());
}
 
Example #28
Source File: RabbitMqConfig.java    From mall-swarm with Apache License 2.0 4 votes vote down vote up
/**
 * 订单实际消费队列
 */
@Bean
public Queue orderQueue() {
    return new Queue(QueueEnum.QUEUE_ORDER_CANCEL.getName());
}