Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed MQ serverMode lost default topic #4981

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ public void send(MQDestination mqDestination, Message message, Callback callback

// 针对不同的topic,引入多线程提升效率
for (Map.Entry<String, Message> entry : messageMap.entrySet()) {
final String topicName = entry.getKey().replace('.', '_');
// 与默认topic匹配直接返回默认topic
final String topicName = mqDestination.getTopic().equals(entry.getKey()) ?
entry.getKey() : entry.getKey().replace('.', '_');
final Message messageSub = entry.getValue();
template.submit((Callable) () -> {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ public void send(MQDestination destination, com.alibaba.otter.canal.protocol.Mes
.messageTopics(message, destination.getTopic(), destination.getDynamicTopic());

for (Map.Entry<String, com.alibaba.otter.canal.protocol.Message> entry : messageMap.entrySet()) {
String topicName = entry.getKey().replace('.', '_');
// 与默认topic匹配直接返回默认topic
String topicName = destination.getTopic().equals(entry.getKey()) ?
entry.getKey() : entry.getKey().replace('.', '_');
com.alibaba.otter.canal.protocol.Message messageSub = entry.getValue();
template.submit(() -> {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ public void send(final MQDestination destination, Message message, Callback call
.messageTopics(message, destination.getTopic(), destination.getDynamicTopic());

for (Map.Entry<String, com.alibaba.otter.canal.protocol.Message> entry : messageMap.entrySet()) {
final String topicName = entry.getKey().replace('.', '_');
// 与默认topic匹配直接返回默认topic
final String topicName = destination.getTopic().equals(entry.getKey()) ?
entry.getKey() : entry.getKey().replace('.', '_');
final com.alibaba.otter.canal.protocol.Message messageSub = entry.getValue();

template.submit(() -> send(destination, topicName, messageSub));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ private void loadRocketMQProperties(Properties properties) {
destination.getDynamicTopic());

for (Map.Entry<String, com.alibaba.otter.canal.protocol.Message> entry : messageMap.entrySet()) {
String topicName = entry.getKey().replace('.', '_');
// 与默认topic匹配直接返回默认topic
String topicName = destination.getTopic().equals(entry.getKey()) ?
entry.getKey() : entry.getKey().replace('.', '_');
com.alibaba.otter.canal.protocol.Message messageSub = entry.getValue();
template.submit(() -> {
try {
Expand Down