Commit 0bbd220c authored by jiaorz's avatar jiaorz

添加积分消息队列接口

parent 72bea98c
......@@ -3,11 +3,7 @@ package com.xxfc.platform.activity.config;
import com.github.wxiaoqi.security.common.config.RabbitCommonConfig;
import com.github.wxiaoqi.security.common.config.rabbit.BindDTO;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import com.xxfc.platform.universal.constant.MQconstant;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
......@@ -23,12 +19,13 @@ public class RabbitActivityConfig extends RabbitCommonConfig {
public static final String INTEGRAL_QUEUE = "integral_queue";
public static final String POPULARZIE_0101_QUEUE = "popularzie.0101.queue";
public static final String INTEGRAL_HANDLE_QUEUE = "integral_handle_queue";
static {
myQueue = new ArrayList<BindDTO>(){{
add(new BindDTO(INTEGRAL_QUEUE, RabbitConstant.ORDER_TOPIC, "order.#"));
add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.register"));
add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.auth"));
add(new BindDTO(INTEGRAL_HANDLE_QUEUE, MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY));
}};
}
......
......@@ -4,6 +4,7 @@ package com.xxfc.platform.activity.handler;
import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.Channel;
import com.xxfc.platform.activity.biz.IntegralUserRecordBiz;
import com.xxfc.platform.activity.config.RabbitActivityConfig;
import com.xxfc.platform.activity.vo.IntegralUserRecordDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
......@@ -26,7 +27,7 @@ public class IntegralMQHandler {
@Autowired
IntegralUserRecordBiz integralUserRecordBiz;
@RabbitListener(queues = "integral_handle_queue")
@RabbitListener(queues = {RabbitActivityConfig.INTEGRAL_HANDLE_QUEUE})
public void integralHandler(Message message, @Headers Map<String, Object> headers, Channel channel) {
ExecutorService executorService = Executors.newCachedThreadPool();
executorService.execute(new Runnable() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment