Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-kafkaconsumer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f48e74d5
authored
May 20, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加大数据消费逻辑
1 parent
83a3a794
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
src/test/java/cn/com/glsx/kafka/service/produce/StujudgeProducerTest.java
src/test/java/cn/com/glsx/kafka/service/produce/StujudgeProducerTest.java
0 → 100644
View file @
f48e74d
package
cn
.
com
.
glsx
.
kafka
.
service
.
produce
;
import
cn.com.glsx.kafka.protocol.BlackAbnormal
;
import
cn.hutool.json.JSONUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author yangll
* @date 2021/5/25 11:25
*/
@Slf4j
public
class
StujudgeProducerTest
{
public
static
void
main
(
String
[]
args
)
{
List
<
byte
[]>
messages
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
1
;
i
++)
{
BlackAbnormal
.
abnormalAndBlackRegion
.
Builder
builder
=
BlackAbnormal
.
abnormalAndBlackRegion
.
newBuilder
();
builder
.
setSn
(
"8701205914"
);
builder
.
setAggkey
(
"GL49467TL"
);
builder
.
setAlarmaddress
(
"江苏省连云港市灌南县灌南县初级中学"
);
builder
.
setAlarmtime
(
"2022-05-12 17:47:34"
);
builder
.
setAlarmtype
(
3
);
builder
.
setStatus
(
1
);
builder
.
setLng
(
118.302986
F
);
builder
.
setLat
(
27.030066
F
);
BlackAbnormal
.
abnormalAndBlackRegion
te
=
builder
.
build
();
log
.
info
(
"AlarmReq==="
+
JSONUtil
.
toJsonStr
(
te
));
byte
[]
h
=
te
.
toByteArray
();
messages
.
add
(
h
);
}
new
ProducerBase
().
baseProducer
(
"black_abnormal_area_alarm"
,
messages
);
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment