Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Apache RocketMQ
Rocketmq
提交
e277216b
R
Rocketmq
项目概览
Apache RocketMQ
/
Rocketmq
上一次同步 大约 3 年
通知
267
Star
16139
Fork
68
代码
文件
提交
分支
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看板
未验证
提交
e277216b
编写于
3月 08, 2021
作者:
S
sunxi92
提交者:
GitHub
3月 08, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ISSUE #2710] Delete unused parameters (#2692)
上级
9eae1d67
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
23 deletion
+13
-23
client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultLitePullConsumerImpl.java
...tmq/client/impl/consumer/DefaultLitePullConsumerImpl.java
+2
-4
client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPullConsumerImpl.java
...ketmq/client/impl/consumer/DefaultMQPullConsumerImpl.java
+4
-7
client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPushConsumerImpl.java
...ketmq/client/impl/consumer/DefaultMQPushConsumerImpl.java
+4
-8
common/src/main/java/org/apache/rocketmq/common/filter/FilterAPI.java
...ain/java/org/apache/rocketmq/common/filter/FilterAPI.java
+2
-3
common/src/test/java/org/apache/rocketmq/common/filter/FilterAPITest.java
...java/org/apache/rocketmq/common/filter/FilterAPITest.java
+1
-1
未找到文件。
client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultLitePullConsumerImpl.java
浏览文件 @
e277216b
...
...
@@ -432,8 +432,7 @@ public class DefaultLitePullConsumerImpl implements MQConsumerInner {
throw
new
IllegalArgumentException
(
"Topic can not be null or empty."
);
}
setSubscriptionType
(
SubscriptionType
.
SUBSCRIBE
);
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
defaultLitePullConsumer
.
getConsumerGroup
(),
topic
,
subExpression
);
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
topic
,
subExpression
);
this
.
rebalanceImpl
.
getSubscriptionInner
().
put
(
topic
,
subscriptionData
);
this
.
defaultLitePullConsumer
.
setMessageQueueListener
(
new
MessageQueueListenerImpl
());
assignedMessageQueue
.
setRebalanceImpl
(
this
.
rebalanceImpl
);
...
...
@@ -749,8 +748,7 @@ public class DefaultLitePullConsumerImpl implements MQConsumerInner {
subscriptionData
=
rebalanceImpl
.
getSubscriptionInner
().
get
(
topic
);
}
else
{
String
topic
=
this
.
messageQueue
.
getTopic
();
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
defaultLitePullConsumer
.
getConsumerGroup
(),
topic
,
SubscriptionData
.
SUB_ALL
);
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
topic
,
SubscriptionData
.
SUB_ALL
);
}
PullResult
pullResult
=
pull
(
messageQueue
,
subscriptionData
,
offset
,
defaultLitePullConsumer
.
getPullBatchSize
());
...
...
client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPullConsumerImpl.java
浏览文件 @
e277216b
...
...
@@ -205,8 +205,7 @@ public class DefaultMQPullConsumerImpl implements MQConsumerInner {
}
try
{
return
FilterAPI
.
buildSubscriptionData
(
this
.
defaultMQPullConsumer
.
getConsumerGroup
(),
mq
.
getTopic
(),
subExpression
);
return
FilterAPI
.
buildSubscriptionData
(
mq
.
getTopic
(),
subExpression
);
}
catch
(
Exception
e
)
{
throw
new
MQClientException
(
"parse subscription error"
,
e
);
}
...
...
@@ -301,8 +300,7 @@ public class DefaultMQPullConsumerImpl implements MQConsumerInner {
public
void
subscriptionAutomatically
(
final
String
topic
)
{
if
(!
this
.
rebalanceImpl
.
getSubscriptionInner
().
containsKey
(
topic
))
{
try
{
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
this
.
defaultMQPullConsumer
.
getConsumerGroup
(),
topic
,
SubscriptionData
.
SUB_ALL
);
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
topic
,
SubscriptionData
.
SUB_ALL
);
this
.
rebalanceImpl
.
subscriptionInner
.
putIfAbsent
(
topic
,
subscriptionData
);
}
catch
(
Exception
ignore
)
{
}
...
...
@@ -365,7 +363,7 @@ public class DefaultMQPullConsumerImpl implements MQConsumerInner {
for
(
String
t
:
topics
)
{
SubscriptionData
ms
=
null
;
try
{
ms
=
FilterAPI
.
buildSubscriptionData
(
t
his
.
groupName
(),
t
,
SubscriptionData
.
SUB_ALL
);
ms
=
FilterAPI
.
buildSubscriptionData
(
t
,
SubscriptionData
.
SUB_ALL
);
}
catch
(
Exception
e
)
{
log
.
error
(
"parse subscription error"
,
e
);
}
...
...
@@ -742,8 +740,7 @@ public class DefaultMQPullConsumerImpl implements MQConsumerInner {
Set
<
String
>
registerTopics
=
this
.
defaultMQPullConsumer
.
getRegisterTopics
();
if
(
registerTopics
!=
null
)
{
for
(
final
String
topic
:
registerTopics
)
{
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
this
.
defaultMQPullConsumer
.
getConsumerGroup
(),
topic
,
SubscriptionData
.
SUB_ALL
);
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
topic
,
SubscriptionData
.
SUB_ALL
);
this
.
rebalanceImpl
.
getSubscriptionInner
().
put
(
topic
,
subscriptionData
);
}
}
...
...
client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPushConsumerImpl.java
浏览文件 @
e277216b
...
...
@@ -827,8 +827,7 @@ public class DefaultMQPushConsumerImpl implements MQConsumerInner {
for
(
final
Map
.
Entry
<
String
,
String
>
entry
:
sub
.
entrySet
())
{
final
String
topic
=
entry
.
getKey
();
final
String
subString
=
entry
.
getValue
();
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
this
.
defaultMQPushConsumer
.
getConsumerGroup
(),
topic
,
subString
);
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
topic
,
subString
);
this
.
rebalanceImpl
.
getSubscriptionInner
().
put
(
topic
,
subscriptionData
);
}
}
...
...
@@ -842,8 +841,7 @@ public class DefaultMQPushConsumerImpl implements MQConsumerInner {
break
;
case
CLUSTERING:
final
String
retryTopic
=
MixAll
.
getRetryTopic
(
this
.
defaultMQPushConsumer
.
getConsumerGroup
());
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
this
.
defaultMQPushConsumer
.
getConsumerGroup
(),
retryTopic
,
SubscriptionData
.
SUB_ALL
);
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
retryTopic
,
SubscriptionData
.
SUB_ALL
);
this
.
rebalanceImpl
.
getSubscriptionInner
().
put
(
retryTopic
,
subscriptionData
);
break
;
default
:
...
...
@@ -874,8 +872,7 @@ public class DefaultMQPushConsumerImpl implements MQConsumerInner {
public
void
subscribe
(
String
topic
,
String
subExpression
)
throws
MQClientException
{
try
{
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
this
.
defaultMQPushConsumer
.
getConsumerGroup
(),
topic
,
subExpression
);
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
topic
,
subExpression
);
this
.
rebalanceImpl
.
getSubscriptionInner
().
put
(
topic
,
subscriptionData
);
if
(
this
.
mQClientFactory
!=
null
)
{
this
.
mQClientFactory
.
sendHeartbeatToAllBrokerWithLock
();
...
...
@@ -887,8 +884,7 @@ public class DefaultMQPushConsumerImpl implements MQConsumerInner {
public
void
subscribe
(
String
topic
,
String
fullClassName
,
String
filterClassSource
)
throws
MQClientException
{
try
{
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
this
.
defaultMQPushConsumer
.
getConsumerGroup
(),
topic
,
"*"
);
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
topic
,
"*"
);
subscriptionData
.
setSubString
(
fullClassName
);
subscriptionData
.
setClassFilterMode
(
true
);
subscriptionData
.
setFilterClassSource
(
filterClassSource
);
...
...
common/src/main/java/org/apache/rocketmq/common/filter/FilterAPI.java
浏览文件 @
e277216b
...
...
@@ -36,8 +36,7 @@ public class FilterAPI {
return
simple
;
}
public
static
SubscriptionData
buildSubscriptionData
(
final
String
consumerGroup
,
String
topic
,
String
subString
)
throws
Exception
{
public
static
SubscriptionData
buildSubscriptionData
(
String
topic
,
String
subString
)
throws
Exception
{
SubscriptionData
subscriptionData
=
new
SubscriptionData
();
subscriptionData
.
setTopic
(
topic
);
subscriptionData
.
setSubString
(
subString
);
...
...
@@ -67,7 +66,7 @@ public class FilterAPI {
public
static
SubscriptionData
build
(
final
String
topic
,
final
String
subString
,
final
String
type
)
throws
Exception
{
if
(
ExpressionType
.
TAG
.
equals
(
type
)
||
type
==
null
)
{
return
buildSubscriptionData
(
null
,
topic
,
subString
);
return
buildSubscriptionData
(
topic
,
subString
);
}
if
(
subString
==
null
||
subString
.
length
()
<
1
)
{
...
...
common/src/test/java/org/apache/rocketmq/common/filter/FilterAPITest.java
浏览文件 @
e277216b
...
...
@@ -33,7 +33,7 @@ public class FilterAPITest {
@Test
public
void
testBuildSubscriptionData
()
throws
Exception
{
SubscriptionData
subscriptionData
=
FilterAPI
.
buildSubscriptionData
(
group
,
topic
,
subString
);
FilterAPI
.
buildSubscriptionData
(
topic
,
subString
);
assertThat
(
subscriptionData
.
getTopic
()).
isEqualTo
(
topic
);
assertThat
(
subscriptionData
.
getSubString
()).
isEqualTo
(
subString
);
String
[]
tags
=
subString
.
split
(
"\\|\\|"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录