mirror of
https://github.com/apache/rocketmq.git
synced 2026-08-28 20:09:14 +08:00
[ISSUE #6747] Add INNER_MULTI_DISPATCH check, can not contains path separator
This commit is contained in:
@@ -17,13 +17,16 @@
|
||||
|
||||
package org.apache.rocketmq.client;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.rocketmq.client.exception.MQClientException;
|
||||
import org.apache.rocketmq.client.producer.DefaultMQProducer;
|
||||
import org.apache.rocketmq.common.TopicConfig;
|
||||
import org.apache.rocketmq.common.UtilAll;
|
||||
import org.apache.rocketmq.common.constant.PermName;
|
||||
import org.apache.rocketmq.common.message.Message;
|
||||
import org.apache.rocketmq.common.message.MessageConst;
|
||||
import org.apache.rocketmq.common.topic.TopicValidator;
|
||||
import org.apache.rocketmq.remoting.protocol.ResponseCode;
|
||||
|
||||
@@ -77,6 +80,12 @@ public class Validators {
|
||||
throw new MQClientException(ResponseCode.MESSAGE_ILLEGAL,
|
||||
"the message body size over max value, MAX: " + defaultMQProducer.getMaxMessageSize());
|
||||
}
|
||||
|
||||
String lmqPath = msg.getUserProperty(MessageConst.PROPERTY_INNER_MULTI_DISPATCH);
|
||||
if (StringUtils.contains(lmqPath, File.separator)) {
|
||||
throw new MQClientException(ResponseCode.MESSAGE_ILLEGAL,
|
||||
"INNER_MULTI_DISPATCH " + lmqPath + " can not contains " + File.separator + " character");
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkTopic(String topic) throws MQClientException {
|
||||
|
||||
@@ -749,6 +749,9 @@ public class ConsumeQueue implements ConsumeQueueInterface, FileQueueLifeCycle {
|
||||
}
|
||||
for (int i = 0; i < queues.length; i++) {
|
||||
String queueName = queues[i];
|
||||
if (StringUtils.contains(queueName, File.separator)) {
|
||||
continue;
|
||||
}
|
||||
long queueOffset = Long.parseLong(queueOffsets[i]);
|
||||
int queueId = request.getQueueId();
|
||||
if (this.messageStore.getMessageStoreConfig().isEnableLmq() && MixAll.isLmq(queueName)) {
|
||||
|
||||
Reference in New Issue
Block a user