1.增加插入数据时的 createTime字段 为 LocalDateTime
2.自动序列和反序列化 CreateTime 字段 3.修改rabbitMQ序列化方法,使其支持 LocalDateTime
This commit is contained in:
@@ -12,6 +12,7 @@ import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,10 +38,11 @@ public class MQSender {
|
||||
public void bigBrotherSend(ServerBigBrother bigBrothers){
|
||||
try {
|
||||
// log.info("{} 接收到的消息数量----------->{}", DateTime.now(),list.size());
|
||||
this.rabbitTemplate.setMessageConverter(new Jackson2JsonMessageConverter());
|
||||
// this.rabbitTemplate.setMessageConverter(new Jackson2JsonMessageConverter());
|
||||
//指定你队列的名字
|
||||
rabbitTemplate.convertAndSend("BIG_BROTHER_QUEUE",bigBrothers);
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage() );
|
||||
throw new BusinessException(ErrorCode.QUEUE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user