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

Revert "使用消息队列构建"

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