Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
Rocketmq
提交
aa535dd3
R
Rocketmq
项目概览
s920243400
/
Rocketmq
与 Fork 源项目一致
Fork自
Apache RocketMQ / Rocketmq
通知
1
Star
1
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看板
提交
aa535dd3
编写于
3月 10, 2017
作者:
Y
yukon
提交者:
dongeforever
6月 06, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ROCKETMQ-139] Degrade the client related modules' JDK version to 1.6
上级
68ebb780
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
41 addition
and
25 deletion
+41
-25
client/pom.xml
client/pom.xml
+5
-1
client/src/main/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumer.java
...pache/rocketmq/client/consumer/DefaultMQPushConsumer.java
+1
-1
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
...apache/rocketmq/client/impl/factory/MQClientInstance.java
+5
-1
client/src/test/java/org/apache/rocketmq/client/consumer/DefaultMQPullConsumerTest.java
...e/rocketmq/client/consumer/DefaultMQPullConsumerTest.java
+2
-2
client/src/test/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumerTest.java
...e/rocketmq/client/consumer/DefaultMQPushConsumerTest.java
+1
-1
client/src/test/java/org/apache/rocketmq/client/consumer/store/LocalFileOffsetStoreTest.java
...ketmq/client/consumer/store/LocalFileOffsetStoreTest.java
+1
-1
client/src/test/java/org/apache/rocketmq/client/consumer/store/RemoteBrokerOffsetStoreTest.java
...mq/client/consumer/store/RemoteBrokerOffsetStoreTest.java
+1
-1
client/src/test/java/org/apache/rocketmq/client/impl/factory/MQClientInstanceTest.java
...he/rocketmq/client/impl/factory/MQClientInstanceTest.java
+3
-3
client/src/test/java/org/apache/rocketmq/client/producer/DefaultMQProducerTest.java
...pache/rocketmq/client/producer/DefaultMQProducerTest.java
+3
-3
client/src/test/java/org/apache/rocketmq/client/producer/selector/SelectMessageQueueByHashTest.java
...lient/producer/selector/SelectMessageQueueByHashTest.java
+1
-1
common/pom.xml
common/pom.xml
+4
-0
common/src/main/java/org/apache/rocketmq/common/MixAll.java
common/src/main/java/org/apache/rocketmq/common/MixAll.java
+2
-2
common/src/test/java/org/apache/rocketmq/common/MixAllTest.java
.../src/test/java/org/apache/rocketmq/common/MixAllTest.java
+3
-3
common/src/test/java/org/apache/rocketmq/common/filter/FilterAPITest.java
...java/org/apache/rocketmq/common/filter/FilterAPITest.java
+1
-1
remoting/pom.xml
remoting/pom.xml
+4
-0
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
...g/apache/rocketmq/remoting/netty/NettyRemotingClient.java
+4
-4
未找到文件。
client/pom.xml
浏览文件 @
aa535dd3
...
...
@@ -22,12 +22,16 @@
<version>
4.1.0-incubating-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
jar
</packaging>
<artifactId>
rocketmq-client
</artifactId>
<name>
rocketmq-client ${project.version}
</name>
<properties>
<maven.compiler.source>
1.6
</maven.compiler.source>
<maven.compiler.target>
1.6
</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>
${project.groupId}
</groupId>
...
...
client/src/main/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumer.java
浏览文件 @
aa535dd3
...
...
@@ -133,7 +133,7 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume
/**
* Subscription relationship
*/
private
Map
<
String
/* topic */
,
String
/* sub expression */
>
subscription
=
new
HashMap
<>();
private
Map
<
String
/* topic */
,
String
/* sub expression */
>
subscription
=
new
HashMap
<
String
,
String
>();
/**
* Message listener
...
...
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
浏览文件 @
aa535dd3
...
...
@@ -842,7 +842,11 @@ public class MQClientInstance {
try
{
this
.
mQClientAPIImpl
.
unregisterClient
(
addr
,
this
.
clientId
,
producerGroup
,
consumerGroup
,
3000
);
log
.
info
(
"unregister client[Producer: {} Consumer: {}] from broker[{} {} {}] success"
,
producerGroup
,
consumerGroup
,
brokerName
,
entry1
.
getKey
(),
addr
);
}
catch
(
RemotingException
|
InterruptedException
|
MQBrokerException
e
)
{
}
catch
(
RemotingException
e
)
{
log
.
error
(
"unregister client exception from broker: "
+
addr
,
e
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"unregister client exception from broker: "
+
addr
,
e
);
}
catch
(
MQBrokerException
e
)
{
log
.
error
(
"unregister client exception from broker: "
+
addr
,
e
);
}
}
...
...
client/src/test/java/org/apache/rocketmq/client/consumer/DefaultMQPullConsumerTest.java
浏览文件 @
aa535dd3
...
...
@@ -99,7 +99,7 @@ public class DefaultMQPullConsumerTest {
assertThat
(
pullResult
.
getNextBeginOffset
()).
isEqualTo
(
1024
+
1
);
assertThat
(
pullResult
.
getMinOffset
()).
isEqualTo
(
123
);
assertThat
(
pullResult
.
getMaxOffset
()).
isEqualTo
(
2048
);
assertThat
(
pullResult
.
getMsgFoundList
()).
isEqualTo
(
new
ArrayList
<>());
assertThat
(
pullResult
.
getMsgFoundList
()).
isEqualTo
(
new
ArrayList
<
Object
>());
}
@Test
...
...
@@ -137,7 +137,7 @@ public class DefaultMQPullConsumerTest {
assertThat
(
pullResult
.
getNextBeginOffset
()).
isEqualTo
(
1024
+
1
);
assertThat
(
pullResult
.
getMinOffset
()).
isEqualTo
(
123
);
assertThat
(
pullResult
.
getMaxOffset
()).
isEqualTo
(
2048
);
assertThat
(
pullResult
.
getMsgFoundList
()).
isEqualTo
(
new
ArrayList
<>());
assertThat
(
pullResult
.
getMsgFoundList
()).
isEqualTo
(
new
ArrayList
<
Object
>());
}
@Override
public
void
onException
(
Throwable
e
)
{
...
...
client/src/test/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumerTest.java
浏览文件 @
aa535dd3
...
...
@@ -143,7 +143,7 @@ public class DefaultMQPushConsumerTest {
doReturn
(
new
FindBrokerResult
(
"127.0.0.1:10911"
,
false
)).
when
(
mQClientFactory
).
findBrokerAddressInSubscribe
(
anyString
(),
anyLong
(),
anyBoolean
());
doReturn
(
Collections
.
singletonList
(
mQClientFactory
.
getClientId
())).
when
(
mQClientFactory
).
findConsumerIdList
(
anyString
(),
anyString
());
Set
<
MessageQueue
>
messageQueueSet
=
new
HashSet
<>();
Set
<
MessageQueue
>
messageQueueSet
=
new
HashSet
<
MessageQueue
>();
messageQueueSet
.
add
(
createPullRequest
().
getMessageQueue
());
pushConsumer
.
getDefaultMQPushConsumerImpl
().
updateTopicSubscribeInfo
(
topic
,
messageQueueSet
);
doReturn
(
123L
).
when
(
rebalancePushImpl
).
computePullFromWhere
(
any
(
MessageQueue
.
class
));
...
...
client/src/test/java/org/apache/rocketmq/client/consumer/store/LocalFileOffsetStoreTest.java
浏览文件 @
aa535dd3
...
...
@@ -69,7 +69,7 @@ public class LocalFileOffsetStoreTest {
offsetStore
.
updateOffset
(
messageQueue
,
1024
,
false
);
assertThat
(
offsetStore
.
readOffset
(
messageQueue
,
ReadOffsetType
.
READ_FROM_STORE
)).
isEqualTo
(-
1
);
offsetStore
.
persistAll
(
new
HashSet
<>(
Collections
.
singletonList
(
messageQueue
)));
offsetStore
.
persistAll
(
new
HashSet
<
MessageQueue
>(
Collections
.
singletonList
(
messageQueue
)));
assertThat
(
offsetStore
.
readOffset
(
messageQueue
,
ReadOffsetType
.
READ_FROM_STORE
)).
isEqualTo
(
1024
);
}
}
\ No newline at end of file
client/src/test/java/org/apache/rocketmq/client/consumer/store/RemoteBrokerOffsetStoreTest.java
浏览文件 @
aa535dd3
...
...
@@ -119,7 +119,7 @@ public class RemoteBrokerOffsetStoreTest {
assertThat
(
offsetStore
.
readOffset
(
messageQueue
,
ReadOffsetType
.
READ_FROM_STORE
)).
isEqualTo
(
1023
);
offsetStore
.
updateOffset
(
messageQueue
,
1025
,
false
);
offsetStore
.
persistAll
(
new
HashSet
<>(
Collections
.
singletonList
(
messageQueue
)));
offsetStore
.
persistAll
(
new
HashSet
<
MessageQueue
>(
Collections
.
singletonList
(
messageQueue
)));
assertThat
(
offsetStore
.
readOffset
(
messageQueue
,
ReadOffsetType
.
READ_FROM_STORE
)).
isEqualTo
(
1025
);
}
...
...
client/src/test/java/org/apache/rocketmq/client/impl/factory/MQClientInstanceTest.java
浏览文件 @
aa535dd3
...
...
@@ -48,17 +48,17 @@ public class MQClientInstanceTest {
TopicRouteData
topicRouteData
=
new
TopicRouteData
();
topicRouteData
.
setFilterServerTable
(
new
HashMap
<
String
,
List
<
String
>>());
List
<
BrokerData
>
brokerDataList
=
new
ArrayList
<>();
List
<
BrokerData
>
brokerDataList
=
new
ArrayList
<
BrokerData
>();
BrokerData
brokerData
=
new
BrokerData
();
brokerData
.
setBrokerName
(
"BrokerA"
);
brokerData
.
setCluster
(
"DefaultCluster"
);
HashMap
<
Long
,
String
>
brokerAddrs
=
new
HashMap
<>();
HashMap
<
Long
,
String
>
brokerAddrs
=
new
HashMap
<
Long
,
String
>();
brokerAddrs
.
put
(
0L
,
"127.0.0.1:10911"
);
brokerData
.
setBrokerAddrs
(
brokerAddrs
);
brokerDataList
.
add
(
brokerData
);
topicRouteData
.
setBrokerDatas
(
brokerDataList
);
List
<
QueueData
>
queueDataList
=
new
ArrayList
<>();
List
<
QueueData
>
queueDataList
=
new
ArrayList
<
QueueData
>();
QueueData
queueData
=
new
QueueData
();
queueData
.
setBrokerName
(
"BrokerA"
);
queueData
.
setPerm
(
6
);
...
...
client/src/test/java/org/apache/rocketmq/client/producer/DefaultMQProducerTest.java
浏览文件 @
aa535dd3
...
...
@@ -194,17 +194,17 @@ public class DefaultMQProducerTest {
TopicRouteData
topicRouteData
=
new
TopicRouteData
();
topicRouteData
.
setFilterServerTable
(
new
HashMap
<
String
,
List
<
String
>>());
List
<
BrokerData
>
brokerDataList
=
new
ArrayList
<>();
List
<
BrokerData
>
brokerDataList
=
new
ArrayList
<
BrokerData
>();
BrokerData
brokerData
=
new
BrokerData
();
brokerData
.
setBrokerName
(
"BrokerA"
);
brokerData
.
setCluster
(
"DefaultCluster"
);
HashMap
<
Long
,
String
>
brokerAddrs
=
new
HashMap
<>();
HashMap
<
Long
,
String
>
brokerAddrs
=
new
HashMap
<
Long
,
String
>();
brokerAddrs
.
put
(
0L
,
"127.0.0.1:10911"
);
brokerData
.
setBrokerAddrs
(
brokerAddrs
);
brokerDataList
.
add
(
brokerData
);
topicRouteData
.
setBrokerDatas
(
brokerDataList
);
List
<
QueueData
>
queueDataList
=
new
ArrayList
<>();
List
<
QueueData
>
queueDataList
=
new
ArrayList
<
QueueData
>();
QueueData
queueData
=
new
QueueData
();
queueData
.
setBrokerName
(
"BrokerA"
);
queueData
.
setPerm
(
6
);
...
...
client/src/test/java/org/apache/rocketmq/client/producer/selector/SelectMessageQueueByHashTest.java
浏览文件 @
aa535dd3
...
...
@@ -34,7 +34,7 @@ public class SelectMessageQueueByHashTest {
Message
message
=
new
Message
(
topic
,
new
byte
[]
{});
List
<
MessageQueue
>
messageQueues
=
new
ArrayList
<>();
List
<
MessageQueue
>
messageQueues
=
new
ArrayList
<
MessageQueue
>();
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
MessageQueue
messageQueue
=
new
MessageQueue
(
topic
,
"DefaultBroker"
,
i
);
messageQueues
.
add
(
messageQueue
);
...
...
common/pom.xml
浏览文件 @
aa535dd3
...
...
@@ -27,6 +27,10 @@
<artifactId>
rocketmq-common
</artifactId>
<name>
rocketmq-common ${project.version}
</name>
<properties>
<maven.compiler.source>
1.6
</maven.compiler.source>
<maven.compiler.target>
1.6
</maven.compiler.target>
</properties>
<dependencies>
<dependency>
...
...
common/src/main/java/org/apache/rocketmq/common/MixAll.java
浏览文件 @
aa535dd3
...
...
@@ -256,7 +256,7 @@ public class MixAll {
if
(
null
==
value
)
{
value
=
""
;
}
}
catch
(
IllegalA
rgumentException
|
IllegalA
ccessException
e
)
{
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -313,7 +313,7 @@ public class MixAll {
try
{
field
.
setAccessible
(
true
);
value
=
field
.
get
(
object
);
}
catch
(
IllegalA
rgumentException
|
IllegalA
ccessException
e
)
{
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
...
...
common/src/test/java/org/apache/rocketmq/common/MixAllTest.java
浏览文件 @
aa535dd3
...
...
@@ -59,9 +59,9 @@ public class MixAllTest {
file
.
delete
();
}
file
.
createNewFile
();
try
(
PrintWriter
out
=
new
PrintWriter
(
fileName
))
{
out
.
write
(
"TestForMixAll"
);
}
PrintWriter
out
=
new
PrintWriter
(
fileName
);
out
.
write
(
"TestForMixAll"
);
out
.
close
();
String
string
=
MixAll
.
file2String
(
fileName
);
assertThat
(
string
).
isEqualTo
(
"TestForMixAll"
);
file
.
delete
();
...
...
common/src/test/java/org/apache/rocketmq/common/filter/FilterAPITest.java
浏览文件 @
aa535dd3
...
...
@@ -36,7 +36,7 @@ public class FilterAPITest {
assertThat
(
subscriptionData
.
getTopic
()).
isEqualTo
(
topic
);
assertThat
(
subscriptionData
.
getSubString
()).
isEqualTo
(
subString
);
String
[]
tags
=
subString
.
split
(
"\\|\\|"
);
Set
<
String
>
tagSet
=
new
HashSet
<>();
Set
<
String
>
tagSet
=
new
HashSet
<
String
>();
for
(
String
tag
:
tags
)
{
tagSet
.
add
(
tag
.
trim
());
}
...
...
remoting/pom.xml
浏览文件 @
aa535dd3
...
...
@@ -27,6 +27,10 @@
<artifactId>
rocketmq-remoting
</artifactId>
<name>
rocketmq-remoting ${project.version}
</name>
<properties>
<maven.compiler.source>
1.6
</maven.compiler.source>
<maven.compiler.target>
1.6
</maven.compiler.target>
</properties>
<dependencies>
<dependency>
...
...
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
浏览文件 @
aa535dd3
...
...
@@ -73,12 +73,12 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
private
final
Bootstrap
bootstrap
=
new
Bootstrap
();
private
final
EventLoopGroup
eventLoopGroupWorker
;
private
final
Lock
lockChannelTables
=
new
ReentrantLock
();
private
final
ConcurrentHashMap
<
String
/* addr */
,
ChannelWrapper
>
channelTables
=
new
ConcurrentHashMap
<>();
private
final
ConcurrentHashMap
<
String
/* addr */
,
ChannelWrapper
>
channelTables
=
new
ConcurrentHashMap
<
String
,
ChannelWrapper
>();
private
final
Timer
timer
=
new
Timer
(
"ClientHouseKeepingService"
,
true
);
private
final
AtomicReference
<
List
<
String
>>
namesrvAddrList
=
new
AtomicReference
<>();
private
final
AtomicReference
<
String
>
namesrvAddrChoosed
=
new
AtomicReference
<>();
private
final
AtomicReference
<
List
<
String
>>
namesrvAddrList
=
new
AtomicReference
<
List
<
String
>
>();
private
final
AtomicReference
<
String
>
namesrvAddrChoosed
=
new
AtomicReference
<
String
>();
private
final
AtomicInteger
namesrvIndex
=
new
AtomicInteger
(
initValueIndex
());
private
final
Lock
lockNamesrvChannel
=
new
ReentrantLock
();
...
...
@@ -522,7 +522,7 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
executorThis
=
this
.
publicExecutor
;
}
Pair
<
NettyRequestProcessor
,
ExecutorService
>
pair
=
new
Pair
<>(
processor
,
executorThis
);
Pair
<
NettyRequestProcessor
,
ExecutorService
>
pair
=
new
Pair
<
NettyRequestProcessor
,
ExecutorService
>(
processor
,
executorThis
);
this
.
processorTable
.
put
(
requestCode
,
pair
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录