Commit f881b38e authored by 赵啸非's avatar 赵啸非

异常日志前端展示添加

parent ee4d021a
package producer; //package producer;
//
//
import cn.hutool.core.util.IdUtil; //import cn.hutool.core.util.IdUtil;
import com.mortals.xhx.ManagerApplication; //import com.mortals.xhx.ManagerApplication;
import com.mortals.xhx.base.system.message.MessageProducer; //import com.mortals.xhx.base.system.message.MessageProducer;
import com.mortals.xhx.module.biz.model.BizLogEntity; //import com.mortals.xhx.module.biz.model.BizLogEntity;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.junit.Test; //import org.junit.Test;
import org.junit.runner.RunWith; //import org.junit.runner.RunWith;
import org.slf4j.Logger; //import org.slf4j.Logger;
import org.slf4j.LoggerFactory; //import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; //import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; //import org.springframework.test.context.junit4.SpringRunner;
//
import java.util.Date; //import java.util.Date;
import java.util.concurrent.CountDownLatch; //import java.util.concurrent.CountDownLatch;
//
@RunWith(SpringRunner.class) //@RunWith(SpringRunner.class)
@SpringBootTest(classes = ManagerApplication.class) //@SpringBootTest(classes = ManagerApplication.class)
@Slf4j //@Slf4j
public class ProducerTest { //public class ProducerTest {
//
@Autowired // @Autowired
private MessageProducer producer; // private MessageProducer producer;
//
@Test // @Test
public void testSyncSend() { // public void testSyncSend() {
//
//for (int i) ////for (int i)
while (true){ // while (true){
BizLogEntity bizLogEntity = new BizLogEntity(); // BizLogEntity bizLogEntity = new BizLogEntity();
bizLogEntity.initAttrValue(); // bizLogEntity.initAttrValue();
bizLogEntity.setTraceID(IdUtil.fastSimpleUUID()); // bizLogEntity.setTraceID(IdUtil.fastSimpleUUID());
bizLogEntity.setLogTime(new Date()); // bizLogEntity.setLogTime(new Date());
producer.syncBizSend(bizLogEntity); // producer.syncBizSend(bizLogEntity);
log.info("[testSyncSend][发送编号:[{}] 发送成功]", bizLogEntity.getTraceID()); // log.info("[testSyncSend][发送编号:[{}] 发送成功]", bizLogEntity.getTraceID());
} // }
//
} // }
//
} //}
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