Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
e86520b8
Commit
e86520b8
authored
Nov 28, 2022
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消费者实例改为两个实例进行消费
parent
5a4174b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
KafkaConsumerService.java
.../com/yeejoin/amos/message/kafka/KafkaConsumerService.java
+1
-1
No files found.
amos-boot-utils/amos-boot-utils-message/src/main/java/com/yeejoin/amos/message/kafka/KafkaConsumerService.java
View file @
e86520b8
...
@@ -28,7 +28,7 @@ public class KafkaConsumerService {
...
@@ -28,7 +28,7 @@ public class KafkaConsumerService {
* 消费单条消息,topics 可以监听多个topic,如:topics = {"topic1", "topic2"}
* 消费单条消息,topics 可以监听多个topic,如:topics = {"topic1", "topic2"}
* @param message 消息
* @param message 消息
*/
*/
@KafkaListener
(
id
=
"consumerSingle"
,
topics
=
"#{'${kafka.topics}'.split(',')}"
,
errorHandler
=
"consumerAwareListenerErrorHandler
"
)
@KafkaListener
(
id
=
"consumerSingle"
,
topics
=
"#{'${kafka.topics}'.split(',')}"
,
concurrency
=
"2
"
)
public
void
consumerSingle
(
String
message
,
Acknowledgment
ack
)
{
public
void
consumerSingle
(
String
message
,
Acknowledgment
ack
)
{
JSONObject
messageObj
=
JSONObject
.
fromObject
(
message
);
JSONObject
messageObj
=
JSONObject
.
fromObject
(
message
);
String
topic
=
messageObj
.
getString
(
"topic"
);
String
topic
=
messageObj
.
getString
(
"topic"
);
...
...
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