提交 1b36ba7e 编写于 作者: hebao@lab.ibiz5.com's avatar hebao@lab.ibiz5.com

Revert "使用消息队列构建"

This reverts commit 6949b074
上级 6949b074
......@@ -8,8 +8,7 @@ module.exports = {
publicPath: './',
// 去除 map 文件 1
productionSourceMap: false,
//outputDir:"../ibzdst-app/ibzdst-app-web/target/classes/META-INF/resources",
outputDir:"../ibzdst-boot/target/classes/META-INF/resources",
outputDir:"../ibzdst-app/ibzdst-app-web/target/classes/META-INF/resources",
devServer: {
host: '0.0.0.0',
port: 8111,
......
此差异已折叠。
......@@ -34,7 +34,6 @@ import org.mybatis.spring.batch.MyBatisCursorItemReader;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
......@@ -74,15 +73,15 @@ public class RuleEngineExService extends RuleEngineServiceImpl {
@Autowired
private IMetaModelService metaModelService;
@Autowired
private SqlSessionFactory sqlSessionFactory;
@Autowired
private DstDataSourceExService dstDataSourceService;
@Autowired
DefaultMQProducer defaultMQProducer;
@Autowired
@Lazy
private SqlSessionFactory sqlSessionFactory;
@Value("${rocketmq.producer.ruleEngineTopic: DSTMSG}")
private String ruleEngineTopic;
......@@ -116,11 +115,11 @@ public class RuleEngineExService extends RuleEngineServiceImpl {
String sql=entityModel.getSqlSegment("CORE");
MyBatisCursorItemReader myMyBatisCursorItemReader =new MyBatisCursorItemReader();
try{
// List<EntityObj> kEntityObjs=dbEntityService.selectCore(entityModel, filter);
// if(kEntityObjs != null){
// this.sendToMQ(et.getEngineId(), kEntityObjs);
// return et;
// }
List<EntityObj> kEntityObjs=dbEntityService.selectCore(entityModel, filter);
if(kEntityObjs != null){
this.sendToMQ(et.getEngineId(), kEntityObjs);
return et;
}
myMyBatisCursorItemReader.setSqlSessionFactory(sqlSessionFactory);
myMyBatisCursorItemReader.setQueryId("cn.ibizlab.core.extensions.mapper.DbEntityMapper.search");
......@@ -146,7 +145,6 @@ public class RuleEngineExService extends RuleEngineServiceImpl {
batch.add(rowdata);
if(batch.size() > 500){
this.sendToMQ(et.getEngineId(), batch);
batch.clear();
}
}
if(batch.size() > 0){
......@@ -155,11 +153,11 @@ public class RuleEngineExService extends RuleEngineServiceImpl {
} catch (Exception e) {
e.printStackTrace();
} finally {
// try {
// myMyBatisCursorItemReader.close();// 关闭游标
// } catch (Exception ex) {
// log.error(ex.getMessage());
// }
try {
myMyBatisCursorItemReader.close();// 关闭游标
} catch (Exception ex) {
log.error(ex.getMessage());
}
DynamicDataSourceContextHolder.poll();
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册