Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
raphaelmichael
Rocketmq
提交
fc54c2ad
R
Rocketmq
项目概览
raphaelmichael
/
Rocketmq
与 Fork 源项目一致
Fork自
Apache RocketMQ / Rocketmq
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rocketmq
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fc54c2ad
编写于
7月 14, 2018
作者:
J
Jaskey
提交者:
von gosling
7月 14, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ROCKETMQ-223-Rename DEFAULT_TOPIC (#119)
上级
461e5166
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
14 addition
and
14 deletion
+14
-14
broker/src/main/java/org/apache/rocketmq/broker/topic/TopicConfigManager.java
.../org/apache/rocketmq/broker/topic/TopicConfigManager.java
+4
-4
broker/src/test/java/org/apache/rocketmq/broker/processor/SendMessageProcessorTest.java
...e/rocketmq/broker/processor/SendMessageProcessorTest.java
+1
-1
client/src/main/java/org/apache/rocketmq/client/Validators.java
.../src/main/java/org/apache/rocketmq/client/Validators.java
+2
-2
client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java
...java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java
+1
-1
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
...apache/rocketmq/client/impl/factory/MQClientInstance.java
+1
-1
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java
...rg/apache/rocketmq/client/producer/DefaultMQProducer.java
+1
-1
client/src/test/java/org/apache/rocketmq/client/ValidatorsTest.java
.../test/java/org/apache/rocketmq/client/ValidatorsTest.java
+2
-2
common/src/main/java/org/apache/rocketmq/common/MixAll.java
common/src/main/java/org/apache/rocketmq/common/MixAll.java
+1
-1
tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExt.java
...va/org/apache/rocketmq/tools/admin/DefaultMQAdminExt.java
+1
-1
未找到文件。
broker/src/main/java/org/apache/rocketmq/broker/topic/TopicConfigManager.java
浏览文件 @
fc54c2ad
...
...
@@ -66,9 +66,9 @@ public class TopicConfigManager extends ConfigManager {
this
.
topicConfigTable
.
put
(
topicConfig
.
getTopicName
(),
topicConfig
);
}
{
// MixAll.
DEFAULT
_TOPIC
// MixAll.
AUTO_CREATE_TOPIC_KEY
_TOPIC
if
(
this
.
brokerController
.
getBrokerConfig
().
isAutoCreateTopicEnable
())
{
String
topic
=
MixAll
.
DEFAULT
_TOPIC
;
String
topic
=
MixAll
.
AUTO_CREATE_TOPIC_KEY
_TOPIC
;
TopicConfig
topicConfig
=
new
TopicConfig
(
topic
);
this
.
systemTopicList
.
add
(
topic
);
topicConfig
.
setReadQueueNums
(
this
.
brokerController
.
getBrokerConfig
()
...
...
@@ -135,7 +135,7 @@ public class TopicConfigManager extends ConfigManager {
}
public
boolean
isTopicCanSendMessage
(
final
String
topic
)
{
return
!
topic
.
equals
(
MixAll
.
DEFAULT
_TOPIC
);
return
!
topic
.
equals
(
MixAll
.
AUTO_CREATE_TOPIC_KEY
_TOPIC
);
}
public
TopicConfig
selectTopicConfig
(
final
String
topic
)
{
...
...
@@ -156,7 +156,7 @@ public class TopicConfigManager extends ConfigManager {
TopicConfig
defaultTopicConfig
=
this
.
topicConfigTable
.
get
(
defaultTopic
);
if
(
defaultTopicConfig
!=
null
)
{
if
(
defaultTopic
.
equals
(
MixAll
.
DEFAULT
_TOPIC
))
{
if
(
defaultTopic
.
equals
(
MixAll
.
AUTO_CREATE_TOPIC_KEY
_TOPIC
))
{
if
(!
this
.
brokerController
.
getBrokerConfig
().
isAutoCreateTopicEnable
())
{
defaultTopicConfig
.
setPerm
(
PermName
.
PERM_READ
|
PermName
.
PERM_WRITE
);
}
...
...
broker/src/test/java/org/apache/rocketmq/broker/processor/SendMessageProcessorTest.java
浏览文件 @
fc54c2ad
...
...
@@ -181,7 +181,7 @@ public class SendMessageProcessorTest {
SendMessageRequestHeader
requestHeader
=
new
SendMessageRequestHeader
();
requestHeader
.
setProducerGroup
(
group
);
requestHeader
.
setTopic
(
topic
);
requestHeader
.
setDefaultTopic
(
MixAll
.
DEFAULT
_TOPIC
);
requestHeader
.
setDefaultTopic
(
MixAll
.
AUTO_CREATE_TOPIC_KEY
_TOPIC
);
requestHeader
.
setDefaultTopicQueueNums
(
3
);
requestHeader
.
setQueueId
(
1
);
requestHeader
.
setSysFlag
(
0
);
...
...
client/src/main/java/org/apache/rocketmq/client/Validators.java
浏览文件 @
fc54c2ad
...
...
@@ -119,9 +119,9 @@ public class Validators {
}
//whether the same with system reserved keyword
if
(
topic
.
equals
(
MixAll
.
DEFAULT
_TOPIC
))
{
if
(
topic
.
equals
(
MixAll
.
AUTO_CREATE_TOPIC_KEY
_TOPIC
))
{
throw
new
MQClientException
(
String
.
format
(
"The topic[%s] is conflict with
default topic
."
,
topic
),
null
);
String
.
format
(
"The topic[%s] is conflict with
AUTO_CREATE_TOPIC_KEY_TOPIC
."
,
topic
),
null
);
}
}
}
client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java
浏览文件 @
fc54c2ad
...
...
@@ -1204,7 +1204,7 @@ public class MQClientAPIImpl {
assert
response
!=
null
;
switch
(
response
.
getCode
())
{
case
ResponseCode
.
TOPIC_NOT_EXIST
:
{
if
(
allowTopicNotExist
&&
!
topic
.
equals
(
MixAll
.
DEFAULT
_TOPIC
))
{
if
(
allowTopicNotExist
&&
!
topic
.
equals
(
MixAll
.
AUTO_CREATE_TOPIC_KEY
_TOPIC
))
{
log
.
warn
(
"get Topic [{}] RouteInfoFromNameServer is not exist value"
,
topic
);
}
...
...
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
浏览文件 @
fc54c2ad
...
...
@@ -654,7 +654,7 @@ public class MQClientInstance {
log
.
warn
(
"updateTopicRouteInfoFromNameServer, getTopicRouteInfoFromNameServer return null, Topic: {}"
,
topic
);
}
}
catch
(
Exception
e
)
{
if
(!
topic
.
startsWith
(
MixAll
.
RETRY_GROUP_TOPIC_PREFIX
)
&&
!
topic
.
equals
(
MixAll
.
DEFAULT
_TOPIC
))
{
if
(!
topic
.
startsWith
(
MixAll
.
RETRY_GROUP_TOPIC_PREFIX
)
&&
!
topic
.
equals
(
MixAll
.
AUTO_CREATE_TOPIC_KEY
_TOPIC
))
{
log
.
warn
(
"updateTopicRouteInfoFromNameServer Exception"
,
e
);
}
}
finally
{
...
...
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java
浏览文件 @
fc54c2ad
...
...
@@ -76,7 +76,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
/**
* Just for testing or demo program
*/
private
String
createTopicKey
=
MixAll
.
DEFAULT
_TOPIC
;
private
String
createTopicKey
=
MixAll
.
AUTO_CREATE_TOPIC_KEY
_TOPIC
;
/**
* Number of queues to create per default topic.
...
...
client/src/test/java/org/apache/rocketmq/client/ValidatorsTest.java
浏览文件 @
fc54c2ad
...
...
@@ -49,12 +49,12 @@ public class ValidatorsTest {
@Test
public
void
testCheckTopic_UseDefaultTopic
()
{
String
defaultTopic
=
MixAll
.
DEFAULT
_TOPIC
;
String
defaultTopic
=
MixAll
.
AUTO_CREATE_TOPIC_KEY
_TOPIC
;
try
{
Validators
.
checkTopic
(
defaultTopic
);
failBecauseExceptionWasNotThrown
(
MQClientException
.
class
);
}
catch
(
MQClientException
e
)
{
assertThat
(
e
).
hasMessageStartingWith
(
String
.
format
(
"The topic[%s] is conflict with
default topic
."
,
defaultTopic
));
assertThat
(
e
).
hasMessageStartingWith
(
String
.
format
(
"The topic[%s] is conflict with
AUTO_CREATE_TOPIC_KEY_TOPIC
."
,
defaultTopic
));
}
}
...
...
common/src/main/java/org/apache/rocketmq/common/MixAll.java
浏览文件 @
fc54c2ad
...
...
@@ -57,7 +57,7 @@ public class MixAll {
public
static
final
String
WS_DOMAIN_SUBGROUP
=
System
.
getProperty
(
"rocketmq.namesrv.domain.subgroup"
,
"nsaddr"
);
//http://jmenv.tbsite.net:8080/rocketmq/nsaddr
//public static final String WS_ADDR = "http://" + WS_DOMAIN_NAME + ":8080/rocketmq/" + WS_DOMAIN_SUBGROUP;
public
static
final
String
DEFAULT_TOPIC
=
"TBW102"
;
public
static
final
String
AUTO_CREATE_TOPIC_KEY_TOPIC
=
"AUTO_CREATE_TOPIC_KEY"
;
// Will be created at broker when isAutoCreateTopicEnable
public
static
final
String
BENCHMARK_TOPIC
=
"BenchmarkTest"
;
public
static
final
String
DEFAULT_PRODUCER_GROUP
=
"DEFAULT_PRODUCER"
;
public
static
final
String
DEFAULT_CONSUMER_GROUP
=
"DEFAULT_CONSUMER"
;
...
...
tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExt.java
浏览文件 @
fc54c2ad
...
...
@@ -59,7 +59,7 @@ import org.apache.rocketmq.tools.admin.api.MessageTrack;
public
class
DefaultMQAdminExt
extends
ClientConfig
implements
MQAdminExt
{
private
final
DefaultMQAdminExtImpl
defaultMQAdminExtImpl
;
private
String
adminExtGroup
=
"admin_ext_group"
;
private
String
createTopicKey
=
MixAll
.
DEFAULT
_TOPIC
;
private
String
createTopicKey
=
MixAll
.
AUTO_CREATE_TOPIC_KEY
_TOPIC
;
private
long
timeoutMillis
=
5000
;
public
DefaultMQAdminExt
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录