|
|
|
@@ -13,7 +13,6 @@ import org.springframework.amqp.core.AmqpTemplate; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.annotation.Profile; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
/** |
|
|
|
@@ -32,15 +31,16 @@ public class RabbitMqMessageProducer implements MqBaseProducer { |
|
|
|
@Autowired |
|
|
|
private WxMsgRecordService wxMsgRecordService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void sendMessage(BaseMsg data, String topic, String tags, String keys) { |
|
|
|
try { |
|
|
|
data.setUuid(UUID.randomUUID().toString()); |
|
|
|
wxMsgRecordService.save(data); |
|
|
|
|
|
|
|
rabbitTemplate.convertAndSend(topic, JsonUtil.obj2Json(data)); |
|
|
|
|
|
|
|
wxMsgRecordService.save(data); |
|
|
|
data.setMsgStatus(EnumMsgRecordStatus.SEND_SUCC.getCode()); |
|
|
|
wxMsgRecordMapper.update(data); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("RabbitMqMessageProducer: Send Message Error ", e); |
|
|
|
} |
|
|
|
|