Skip to content

Commit

Permalink
Set up DB
Browse files Browse the repository at this point in the history
  • Loading branch information
Pil0tXia committed Jan 4, 2024
1 parent eb98fb7 commit 4b39c6d
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 38 deletions.
14 changes: 10 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ repositories {
ext {
// utility
commonsLang3Version = '3.13.0'
guavaVersion = '32.1.2-jre' // not used for now
fastjsonVersion = '2.0.40'
// swagger
springdocVersion = '1.7.0'
Expand All @@ -64,13 +63,20 @@ dependencies {

// utility
implementation "org.apache.commons:commons-lang3:${commonsLang3Version}"
implementation("com.alibaba.fastjson2:fastjson2:${fastjsonVersion}")
implementation "com.alibaba.fastjson2:fastjson2:${fastjsonVersion}"
// swagger
implementation "org.springdoc:springdoc-openapi-ui:${springdocVersion}"
implementation "org.springdoc:springdoc-openapi-javadoc:${springdocVersion}"
annotationProcessor 'com.github.therapi:therapi-runtime-javadoc-scribe:0.15.0'
// unit test
testImplementation("org.mockito:mockito-core:${mockitoVersion}")
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
// meta
implementation("com.alibaba.nacos:nacos-client:${nacosVersion}")
implementation "com.alibaba.nacos:nacos-client:${nacosVersion}"
// Event Store
implementation 'org.apache.rocketmq:rocketmq-client:4.9.7'

// Database
implementation 'com.alibaba:druid-spring-boot-starter:1.2.21'
implementation 'com.baomidou:mybatis-plus-boot-starter:3.5.5'
runtimeOnly 'com.mysql:mysql-connector-j'
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;

@ServletComponentScan // Druid Monitor
@SpringBootApplication
public class EventMeshDashboardApplication {

Expand Down
75 changes: 75 additions & 0 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/eventmesh-dashboard?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password:

initial-size: 1
max-active: 50
min-idle: 5
max-wait: 6000
validation-query: select 'x'
validation-query-timeout: 15
test-on-borrow: false
test-while-idle: true
min-evictable-idle-time-millis: 300000

stat-view-servlet:
enabled: true
url-pattern: /druid/*
filter:
wall:
config:
multi-statement-allow: true # corresponding to allowMultiQueries=true

eventmesh:
meta:
# registry type: nacos, etcd
type: nacos
nacos:
addr: 127.0.0.1:8848
namespace: # namespace id, empty by default
authEnabled: false
protocol: http # http or https
username:
password:
# Alibaba Cloud MSE Nacos auth, not nacos.token.secret.key
accessKey:
secretKey:
etcd:
addr: # TODO
# timeout for admin client
timeoutMs: 5000
store:
# Event Store type, should be consistent with the EventMesh Runtime configuration.
type: rocketmq
standalone:
# TODO
rocketmq:
namesrvAddr: 127.0.0.1:9876;127.0.0.1:9876
clusterName: DefaultCluster
accessKey: '********'
secretKey: '********'
kafka:
namesrvAddr: localhost:9092;localhost:9092
partitions: 1
replicationFactors: 1
42 changes: 9 additions & 33 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

spring:
application:
name: eventmesh-dashboard
profiles:
active: dev

server:
port: 8080
Expand All @@ -30,35 +31,10 @@ server:
logging:
config: classpath:logback.xml

eventmesh:
meta:
# registry type: nacos, etcd
type: nacos
nacos:
addr: 127.0.0.1:8848
namespace: # namespace id, empty by default
authEnabled: false
protocol: http # http or https
username:
password:
# Alibaba Cloud MSE Nacos auth, not nacos.token.secret.key
accessKey:
secretKey:
etcd:
addr: # TODO
# timeout for admin client
timeoutMs: 5000
store:
# Event Store type, should be consistent with the EventMesh Runtime configuration.
type: rocketmq
standalone:
# TODO
rocketmq:
namesrvAddr: 127.0.0.1:9876;127.0.0.1:9876
clusterName: DefaultCluster
accessKey: '********'
secretKey: '********'
kafka:
namesrvAddr: localhost:9092;localhost:9092
partitions: 1
replicationFactors: 1
mybatis-plus:
mapper-locations: classpath*:mappers/**/*.xml # Default value
typeAliasesPackage: org.apache.eventmesh.dashboard.entity
configuration:
call-setters-on-nulls: true # Display fields with null values in query results
map-underscore-to-camel-case: true # Convert database underscore naming convention to camel case (default is true)
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # Output SQL execution logs to console (for debugging)
2 changes: 1 addition & 1 deletion src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</encoder>
</appender>

<root level="DEBUG">
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
Expand Down

0 comments on commit 4b39c6d

Please sign in to comment.