|
|
|
@@ -9,7 +9,6 @@ import com.iformall.service.impl.SendEmailServiceImpl; |
|
|
|
import com.iformall.service.impl.SendSmartAppMsgServiceImpl; |
|
|
|
import com.iformall.service.impl.SendSmsServiceImpl; |
|
|
|
import com.iformall.utils.JsonUtil; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -18,7 +17,6 @@ import org.springframework.stereotype.Service; |
|
|
|
/** |
|
|
|
* 消息消费入口 |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
public class MqBaseConsumer { |
|
|
|
private final Logger log = LoggerFactory.getLogger(this.getClass()); |
|
|
|
@@ -35,10 +33,9 @@ public class MqBaseConsumer { |
|
|
|
|
|
|
|
public void doMessage(String message) { |
|
|
|
log.info("received message: {}", message); |
|
|
|
|
|
|
|
BaseMsg baseMsg = null; |
|
|
|
|
|
|
|
try { |
|
|
|
log.info("received message: {}", message); |
|
|
|
baseMsg = (BaseMsg)JsonUtil.readValue(message,BaseMsg.class); |
|
|
|
|
|
|
|
if(EnumMsgRecordType.SMS.getCode().equals(baseMsg.getMsgType())){ |
|
|
|
@@ -54,7 +51,6 @@ public class MqBaseConsumer { |
|
|
|
baseMsg.setMsgStatus(EnumMsgRecordStatus.CONSUME_SUCC.getCode()); |
|
|
|
wxMsgRecordMapper.update(baseMsg); |
|
|
|
}catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
if(null != baseMsg){ |
|
|
|
baseMsg.setStatusMessage(e.getMessage()); |
|
|
|
baseMsg.setMsgStatus(EnumMsgRecordStatus.CONSUME_FAIL.getCode()); |
|
|
|
|