Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
matrix-sample
Overview
Overview
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
mall
arch
matrix-sample
Commits
513e03f8
Commit
513e03f8
authored
Mar 19, 2020
by
qiuweili123
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整示例rocketmq
parent
dc8d1ef5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
RoketMqSampleApplication.java
matrix-sample-rocketmq/matrix-sample-rocketmq-springboot/src/main/java/com/secoo/rocketmq/RoketMqSampleApplication.java
+5
-2
No files found.
matrix-sample-rocketmq/matrix-sample-rocketmq-springboot/src/main/java/com/secoo/rocketmq/RoketMqSampleApplication.java
View file @
513e03f8
...
@@ -28,15 +28,17 @@ public class RoketMqSampleApplication implements ApplicationRunner {
...
@@ -28,15 +28,17 @@ public class RoketMqSampleApplication implements ApplicationRunner {
user
.
setId
(
1L
);
user
.
setId
(
1L
);
user
.
setName
(
"zhangsan"
);
user
.
setName
(
"zhangsan"
);
String
createTagName
=
":create"
;
String
createTagName
=
":create"
;
String
createTagName2
=
":create2"
;
//1.没有指定tag,单项发送消息
//1.没有指定tag,单项发送消息
template
.
sendOneWay
(
topicName
,
user
);
template
.
sendOneWay
(
topicName
,
user
);
/* 注意:org.springframework.messaging.Message为默认对象,此对象是spring对所有消息体的抽象,
/* 注意:org.springframework.messaging.Message为默认对象,此对象是spring对所有消息体的抽象,
* 而MessageExt为RoketMq自身对象,包含更细节信息,如msgId
* 而MessageExt为RoketMq自身对象,包含更细节信息,如msgId
* */
* */
//2.指定tag,并同步发送消息
//2.指定tag,并同步发送消息
//指定tag为create发送到topic
//指定tag为create发送到topic
。topic和name之间用“:”分割
template
.
syncSend
(
topicName
+
createTagName
,
user
,
10000
);
template
.
syncSend
(
topicName
+
createTagName
2
,
user
,
10000
);
}
}
}
}
\ No newline at end of file
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