Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
logtransfer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢宇轩
logtransfer
Commits
fc26f103
Commit
fc26f103
authored
Dec 12, 2021
by
谢宇轩
😅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整代码结构
parent
38764ddb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
README.md
README.md
+8
-0
customer.go
source/customer.go
+5
-3
kernel.go
transfer/kernel.go
+4
-0
No files found.
README.md
View file @
fc26f103
...
...
@@ -9,3 +9,11 @@
2.
管道的形式处理数据
3.
提供数据同步到ES的插件
### 2.0.0
1.
支持动态的安装卸载插件
# 安装
```
docker build -t logtransfer:2.0 .
docker run -d --name=LTF logtransfer:2.0
```
source/customer.go
View file @
fc26f103
...
...
@@ -18,9 +18,9 @@ var (
// 消费处理器
type
Customer
struct
{
Reader
*
kafka
.
Reader
// 特定消费者的专属Kafka Reader
HandlePipeline
*
plugin
.
PipeLine
// 从Topic中构建的Piepline
Format
entity
.
Formater
// 解析元数据的格式器
Reader
*
kafka
.
Reader
// 特定消费者的专属Kafka Reader
(我从哪里来)
HandlePipeline
*
plugin
.
PipeLine
// 从Topic中构建的Piepline
(要到那里去)
Format
entity
.
Formater
// 解析元数据的格式器
(变形记。。)
done
chan
struct
{}
// 结束标志
}
...
...
@@ -86,6 +86,8 @@ func ReadingMessage(ctx context.Context, c *Customer) {
select
{
case
<-
c
.
Listen
()
:
// 监听需要关闭的信号
c
.
Exit
()
log
.
Println
(
"Close customer of Topic :"
,
c
.
Reader
.
Config
()
.
Topic
)
return
default
:
...
...
transfer/kernel.go
View file @
fc26f103
...
...
@@ -67,6 +67,10 @@ func Run(confPath string) {
Start
<-
currentCustomer
}
// TODO: 还要监听Topic的配置变更
// 目前是通过topic的name来注册所有的消费处理器
// 所以直接给对应的topic中的customer重启就可以杀了就可以了
for
sign
:=
range
sign
()
{
switch
sign
{
case
syscall
.
SIGHUP
,
syscall
.
SIGINT
,
syscall
.
SIGTERM
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment