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

cassandra配置调整及报表相关接口文件定义

上级 e640ff99
......@@ -23,22 +23,17 @@ spring:
caffeine:
spec: initialCapacity=5,maximumSize=50000,expireAfterWrite=3600s
cassandra:
host: 172.16.100.243
cluster:
name: cluster
port: 9042
keyspace: ibzdst
class: SimpleStrategy
replication_factor: 3
#cassandra:
# host: 172.16.100.243
# keyspace: ibzdst
rocketmq:
producer:
isOnOff: on
namesrvAddr: 172.16.180.243:9876
namesrvAddr: 172.16.170.163:9876
consumer:
isOnOff: on
namesrvAddr: 172.16.180.243:9876
namesrvAddr: 172.16.170.163:9876
logging:
config: classpath:logback-spring.xml
\ No newline at end of file
......@@ -6,6 +6,7 @@ import com.datastax.driver.core.schemabuilder.SchemaBuilder;
import com.datastax.driver.mapping.Mapper;
import com.datastax.driver.mapping.MappingManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Repository;
import java.sql.Timestamp;
......@@ -17,6 +18,7 @@ import static com.datastax.driver.core.querybuilder.QueryBuilder.*;
@Slf4j
@Repository
@ConditionalOnExpression("!''.equals('${cassandra.host:}')")
public class ExecResultRepository {
private Mapper<ExecResult> mapper;
......
package cn.ibizlab.core.extensions.service;
import org.springframework.stereotype.Service;
@Service
public class DACoreService {
}
......@@ -11,6 +11,7 @@ import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.common.message.MessageExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
......@@ -24,7 +25,8 @@ public class ResultsMQMsgConsumeListener implements MessageListenerConcurrently
@Value("${rocketmq.producer.resultsTopic:DSTRESULTSMSG}")
private String resultsTopic;
@Autowired
@Autowired(required = false)
@Lazy
private ExecResultRepository execResultRepository;
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
......
......@@ -14,6 +14,7 @@ import com.datastax.driver.core.policies.RetryPolicy;
import com.datastax.driver.core.policies.TokenAwarePolicy;
import com.datastax.driver.mapping.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
......@@ -27,11 +28,12 @@ import static com.datastax.driver.core.schemabuilder.SchemaBuilder.createKeyspac
import static com.datastax.driver.mapping.NamingConventions.*;
@Configuration
@ConditionalOnExpression("!''.equals('${cassandra.host:}')")
public class CassandraConfig {
@Bean
public Cluster cluster(
@Value("${cassandra.host:172.16.100.243}") String host,
@Value("${cassandra.host}") String host,
@Value("${cassandra.cluster.name:cluster}") String clusterName,
@Value("${cassandra.options.maxrequestsperconnection:64}") int maxRequestsPerConnection,
@Value("${cassandra.options.newconnectionthreshold:100}") int newConnectionThreshold,
......
package cn.ibizlab.api.rest.extensions;
import cn.ibizlab.core.extensions.service.DACoreService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@Api(tags = {"接口" })
@RestController("api-dacore")
@RequestMapping("")
public class DACoreResource {
@Autowired
private DACoreService daCoreService;
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册