Commit 9df7c716 by 阳浪

消息优化

parent 512e82f7
......@@ -7,20 +7,23 @@ import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: shengchenglong
* @Date: 2018/4/18 11:14
*/
@Component
@RabbitListener(queues = Constans.MESSAGE_QUEUE)
public class MessageEventListener {
@RestController
public class MessageEventListener{
@Autowired
private MessageEventHandler messageEventHandler;
@RabbitHandler
public void processBizEvent(EventWrapper<MessageRemindVo> ew) {
@PostMapping("/remote/manage/messageAccount/processBizEvent")
public void processBizEvent(@RequestBody EventWrapper<MessageRemindVo> ew) {
messageEventHandler.handle(ew);
}
......
......@@ -13,6 +13,7 @@ import com.yizhi.message.application.controller.util.MessageUtil;
import com.yizhi.message.application.controller.util.QueryAccount;
import com.yizhi.message.application.domain.*;
import com.yizhi.message.application.enums.MessageStatus;
import com.yizhi.message.application.event.MessageEventHandler;
import com.yizhi.message.application.mapper.MessageMapper;
import com.yizhi.message.application.service.*;
import com.yizhi.message.application.vo.*;
......@@ -72,7 +73,7 @@ public class MessageServiceImple extends ServiceImpl<MessageMapper, Message> imp
@Autowired
private MessageParameterService messageParameterService;
@Autowired
private CloudEventPublisher cloudEventPublisher;
private MessageEventHandler messageEventHandler;
private static final Logger logger = LoggerFactory.getLogger(MessageServiceImple.class);
......@@ -658,7 +659,7 @@ public class MessageServiceImple extends ServiceImpl<MessageMapper, Message> imp
vo1.setRequestContext(context);
try {
cloudEventPublisher.publish(Constans.MESSAGE_QUEUE, new EventWrapper<MessageRemindVo>(null, vo1));
messageEventHandler.handle(new EventWrapper<MessageRemindVo>(null, vo1));
d = true;
} catch (Exception e) {
e.printStackTrace();
......
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