Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小五666\n哈哈
Rocketmq
提交
044222b5
R
Rocketmq
项目概览
小五666\n哈哈
/
Rocketmq
与 Fork 源项目一致
Fork自
Apache RocketMQ / Rocketmq
通知
1
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看板
提交
044222b5
编写于
1月 25, 2019
作者:
D
duhenglucky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix the subscription data type error issue
上级
c9282de2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
5 addition
and
9 deletion
+5
-9
client/src/main/java/org/apache/rocketmq/client/impl/consumer/RebalancePushImpl.java
...ache/rocketmq/client/impl/consumer/RebalancePushImpl.java
+1
-3
common/src/main/java/org/apache/rocketmq/common/flowcontrol/AbstractFlowControlService.java
...cketmq/common/flowcontrol/AbstractFlowControlService.java
+2
-0
snode/src/main/java/org/apache/rocketmq/snode/client/impl/SubscriptionManagerImpl.java
...e/rocketmq/snode/client/impl/SubscriptionManagerImpl.java
+1
-1
snode/src/main/java/org/apache/rocketmq/snode/processor/HeartbeatProcessor.java
...g/apache/rocketmq/snode/processor/HeartbeatProcessor.java
+1
-5
未找到文件。
client/src/main/java/org/apache/rocketmq/client/impl/consumer/RebalancePushImpl.java
浏览文件 @
044222b5
...
@@ -31,7 +31,6 @@ import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
...
@@ -31,7 +31,6 @@ import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
import
org.apache.rocketmq.common.message.MessageQueue
;
import
org.apache.rocketmq.common.message.MessageQueue
;
import
org.apache.rocketmq.common.protocol.heartbeat.ConsumeType
;
import
org.apache.rocketmq.common.protocol.heartbeat.ConsumeType
;
import
org.apache.rocketmq.common.protocol.heartbeat.MessageModel
;
import
org.apache.rocketmq.common.protocol.heartbeat.MessageModel
;
import
org.apache.rocketmq.common.protocol.heartbeat.PushSubscriptionData
;
import
org.apache.rocketmq.common.protocol.heartbeat.SubscriptionData
;
import
org.apache.rocketmq.common.protocol.heartbeat.SubscriptionData
;
public
class
RebalancePushImpl
extends
RebalanceImpl
{
public
class
RebalancePushImpl
extends
RebalanceImpl
{
...
@@ -55,8 +54,7 @@ public class RebalancePushImpl extends RebalanceImpl {
...
@@ -55,8 +54,7 @@ public class RebalancePushImpl extends RebalanceImpl {
* When rebalance result changed, should update subscription's version to notify broker.
* When rebalance result changed, should update subscription's version to notify broker.
* Fix: inconsistency subscription may lead to consumer miss messages.
* Fix: inconsistency subscription may lead to consumer miss messages.
*/
*/
SubscriptionData
sub
=
this
.
subscriptionInner
.
get
(
topic
);
SubscriptionData
subscriptionData
=
this
.
subscriptionInner
.
get
(
topic
);
PushSubscriptionData
subscriptionData
=
(
PushSubscriptionData
)
sub
;
long
newVersion
=
System
.
currentTimeMillis
();
long
newVersion
=
System
.
currentTimeMillis
();
log
.
info
(
"{} Rebalance changed, also update version: {}, {}"
,
topic
,
subscriptionData
.
getSubVersion
(),
newVersion
);
log
.
info
(
"{} Rebalance changed, also update version: {}, {}"
,
topic
,
subscriptionData
.
getSubVersion
(),
newVersion
);
subscriptionData
.
setSubVersion
(
newVersion
);
subscriptionData
.
setSubVersion
(
newVersion
);
...
...
common/src/main/java/org/apache/rocketmq/common/flowcontrol/AbstractFlowControlService.java
浏览文件 @
044222b5
...
@@ -74,6 +74,7 @@ public abstract class AbstractFlowControlService implements Interceptor {
...
@@ -74,6 +74,7 @@ public abstract class AbstractFlowControlService implements Interceptor {
Boolean
acquired
=
this
.
acquiredThreadLocal
.
get
();
Boolean
acquired
=
this
.
acquiredThreadLocal
.
get
();
if
(
acquired
!=
null
&&
acquired
)
{
if
(
acquired
!=
null
&&
acquired
)
{
SphO
.
exit
();
SphO
.
exit
();
this
.
acquiredThreadLocal
.
remove
();
}
}
}
}
...
@@ -82,6 +83,7 @@ public abstract class AbstractFlowControlService implements Interceptor {
...
@@ -82,6 +83,7 @@ public abstract class AbstractFlowControlService implements Interceptor {
Boolean
acquired
=
this
.
acquiredThreadLocal
.
get
();
Boolean
acquired
=
this
.
acquiredThreadLocal
.
get
();
if
(
acquired
!=
null
&&
acquired
)
{
if
(
acquired
!=
null
&&
acquired
)
{
SphO
.
exit
();
SphO
.
exit
();
this
.
acquiredThreadLocal
.
remove
();
}
}
}
}
...
...
snode/src/main/java/org/apache/rocketmq/snode/client/impl/SubscriptionManagerImpl.java
浏览文件 @
044222b5
...
@@ -56,7 +56,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
...
@@ -56,7 +56,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
Set
<
RemotingChannel
>
prev
=
pushTable
.
putIfAbsent
(
messageQueue
,
clientSet
);
Set
<
RemotingChannel
>
prev
=
pushTable
.
putIfAbsent
(
messageQueue
,
clientSet
);
clientSet
=
prev
!=
null
?
prev
:
clientSet
;
clientSet
=
prev
!=
null
?
prev
:
clientSet
;
}
}
log
.
info
(
"Register push session message queue: {}, group: {} remoting: {}"
,
messageQueue
,
groupId
,
remotingChannel
.
remoteAddress
());
log
.
debug
(
"Register push session message queue: {}, group: {} remoting: {}"
,
messageQueue
,
groupId
,
remotingChannel
.
remoteAddress
());
clientSet
.
add
(
remotingChannel
);
clientSet
.
add
(
remotingChannel
);
}
}
}
}
...
...
snode/src/main/java/org/apache/rocketmq/snode/processor/HeartbeatProcessor.java
浏览文件 @
044222b5
...
@@ -20,7 +20,6 @@ import io.netty.channel.Channel;
...
@@ -20,7 +20,6 @@ import io.netty.channel.Channel;
import
io.netty.util.Attribute
;
import
io.netty.util.Attribute
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Set
;
import
java.util.Set
;
import
org.apache.rocketmq.common.MixAll
;
import
org.apache.rocketmq.common.constant.LoggerName
;
import
org.apache.rocketmq.common.constant.LoggerName
;
import
org.apache.rocketmq.common.protocol.RequestCode
;
import
org.apache.rocketmq.common.protocol.RequestCode
;
import
org.apache.rocketmq.common.protocol.ResponseCode
;
import
org.apache.rocketmq.common.protocol.ResponseCode
;
...
@@ -75,15 +74,12 @@ public class HeartbeatProcessor implements RequestProcessor {
...
@@ -75,15 +74,12 @@ public class HeartbeatProcessor implements RequestProcessor {
Client
client
=
new
Client
();
Client
client
=
new
Client
();
client
.
setClientId
(
heartbeatData
.
getClientID
());
client
.
setClientId
(
heartbeatData
.
getClientID
());
client
.
setRemotingChannel
(
remotingChannel
);
client
.
setRemotingChannel
(
remotingChannel
);
Set
<
String
>
groupSet
=
new
HashSet
<>();
for
(
ProducerData
producerData
:
heartbeatData
.
getProducerDataSet
())
{
for
(
ProducerData
producerData
:
heartbeatData
.
getProducerDataSet
())
{
client
.
setClientRole
(
ClientRole
.
Producer
);
client
.
setClientRole
(
ClientRole
.
Producer
);
if
(!
MixAll
.
CLIENT_INNER_PRODUCER_GROUP
.
equals
(
producerData
.
getGroupName
()))
{
groupSet
.
add
(
producerData
.
getGroupName
());
}
this
.
snodeController
.
getProducerManager
().
register
(
producerData
.
getGroupName
(),
client
);
this
.
snodeController
.
getProducerManager
().
register
(
producerData
.
getGroupName
(),
client
);
}
}
Set
<
String
>
groupSet
=
new
HashSet
<>();
for
(
ConsumerData
consumerData
:
heartbeatData
.
getConsumerDataSet
())
{
for
(
ConsumerData
consumerData
:
heartbeatData
.
getConsumerDataSet
())
{
client
.
setClientRole
(
ClientRole
.
Consumer
);
client
.
setClientRole
(
ClientRole
.
Consumer
);
groupSet
.
add
(
consumerData
.
getGroupName
());
groupSet
.
add
(
consumerData
.
getGroupName
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录