Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小五666\n哈哈
Rocketmq
提交
bd21a92d
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看板
提交
bd21a92d
编写于
2月 22, 2019
作者:
C
chengxiangwang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add MqttConfig.java
上级
5a3102d9
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
170 addition
and
1 deletion
+170
-1
common/src/main/java/org/apache/rocketmq/common/MqttConfig.java
.../src/main/java/org/apache/rocketmq/common/MqttConfig.java
+168
-0
snode/src/main/java/org/apache/rocketmq/snode/SnodeController.java
.../main/java/org/apache/rocketmq/snode/SnodeController.java
+2
-1
未找到文件。
common/src/main/java/org/apache/rocketmq/common/MqttConfig.java
0 → 100644
浏览文件 @
bd21a92d
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.rocketmq.common
;
import
java.net.InetAddress
;
import
java.net.UnknownHostException
;
import
org.apache.rocketmq.common.annotation.ImportantField
;
import
org.apache.rocketmq.common.constant.LoggerName
;
import
org.apache.rocketmq.logging.InternalLogger
;
import
org.apache.rocketmq.logging.InternalLoggerFactory
;
public
class
MqttConfig
{
private
static
final
InternalLogger
log
=
InternalLoggerFactory
.
getLogger
(
LoggerName
.
SNODE_LOGGER_NAME
);
private
String
rocketmqHome
=
System
.
getProperty
(
MixAll
.
ROCKETMQ_HOME_PROPERTY
,
System
.
getenv
(
MixAll
.
ROCKETMQ_HOME_ENV
));
private
int
snodeHandleMqttThreadPoolQueueCapacity
=
10000
;
private
int
snodeHandleMqttMessageMinPoolSize
=
10
;
private
int
snodeHandleMqttMessageMaxPoolSize
=
20
;
private
long
houseKeepingInterval
=
10
*
1000
;
private
int
snodePushMqttMessageMinPoolSize
=
10
;
private
int
snodePushMqttMessageMaxPoolSize
=
20
;
private
int
snodePushMqttMessageThreadPoolQueueCapacity
=
10000
;
private
int
listenPort
=
1883
;
/**
* Acl feature switch
*/
@ImportantField
private
boolean
aclEnable
=
false
;
public
long
getHouseKeepingInterval
()
{
return
houseKeepingInterval
;
}
public
void
setHouseKeepingInterval
(
long
houseKeepingInterval
)
{
this
.
houseKeepingInterval
=
houseKeepingInterval
;
}
/**
* This configurable item defines interval of topics registration of broker to name server. Allowing values are
* between 10, 000 and 60, 000 milliseconds.
*/
private
int
registerNameServerPeriod
=
1000
*
30
;
public
int
getRegisterNameServerPeriod
()
{
return
registerNameServerPeriod
;
}
public
void
setRegisterNameServerPeriod
(
int
registerNameServerPeriod
)
{
this
.
registerNameServerPeriod
=
registerNameServerPeriod
;
}
@ImportantField
private
boolean
fetchNamesrvAddrByAddressServer
=
false
;
public
static
String
localHostName
()
{
try
{
return
InetAddress
.
getLocalHost
().
getHostName
();
}
catch
(
UnknownHostException
e
)
{
log
.
error
(
"Failed to obtain the host name"
,
e
);
}
return
"DEFAULT_SNODE"
;
}
public
boolean
isFetchNamesrvAddrByAddressServer
()
{
return
fetchNamesrvAddrByAddressServer
;
}
public
void
setFetchNamesrvAddrByAddressServer
(
boolean
fetchNamesrvAddrByAddressServer
)
{
this
.
fetchNamesrvAddrByAddressServer
=
fetchNamesrvAddrByAddressServer
;
}
public
int
getListenPort
()
{
return
listenPort
;
}
public
String
getRocketmqHome
()
{
return
rocketmqHome
;
}
public
void
setRocketmqHome
(
String
rocketmqHome
)
{
this
.
rocketmqHome
=
rocketmqHome
;
}
public
void
setListenPort
(
int
listenPort
)
{
this
.
listenPort
=
listenPort
;
}
public
int
getSnodeHandleMqttThreadPoolQueueCapacity
()
{
return
snodeHandleMqttThreadPoolQueueCapacity
;
}
public
void
setSnodeHandleMqttThreadPoolQueueCapacity
(
int
snodeHandleMqttThreadPoolQueueCapacity
)
{
this
.
snodeHandleMqttThreadPoolQueueCapacity
=
snodeHandleMqttThreadPoolQueueCapacity
;
}
public
int
getSnodeHandleMqttMessageMinPoolSize
()
{
return
snodeHandleMqttMessageMinPoolSize
;
}
public
void
setSnodeHandleMqttMessageMinPoolSize
(
int
snodeHandleMqttMessageMinPoolSize
)
{
this
.
snodeHandleMqttMessageMinPoolSize
=
snodeHandleMqttMessageMinPoolSize
;
}
public
int
getSnodeHandleMqttMessageMaxPoolSize
()
{
return
snodeHandleMqttMessageMaxPoolSize
;
}
public
void
setSnodeHandleMqttMessageMaxPoolSize
(
int
snodeHandleMqttMessageMaxPoolSize
)
{
this
.
snodeHandleMqttMessageMaxPoolSize
=
snodeHandleMqttMessageMaxPoolSize
;
}
public
int
getSnodePushMqttMessageMinPoolSize
()
{
return
snodePushMqttMessageMinPoolSize
;
}
public
void
setSnodePushMqttMessageMinPoolSize
(
int
snodePushMqttMessageMinPoolSize
)
{
this
.
snodePushMqttMessageMinPoolSize
=
snodePushMqttMessageMinPoolSize
;
}
public
int
getSnodePushMqttMessageMaxPoolSize
()
{
return
snodePushMqttMessageMaxPoolSize
;
}
public
void
setSnodePushMqttMessageMaxPoolSize
(
int
snodePushMqttMessageMaxPoolSize
)
{
this
.
snodePushMqttMessageMaxPoolSize
=
snodePushMqttMessageMaxPoolSize
;
}
public
int
getSnodePushMqttMessageThreadPoolQueueCapacity
()
{
return
snodePushMqttMessageThreadPoolQueueCapacity
;
}
public
void
setSnodePushMqttMessageThreadPoolQueueCapacity
(
int
snodePushMqttMessageThreadPoolQueueCapacity
)
{
this
.
snodePushMqttMessageThreadPoolQueueCapacity
=
snodePushMqttMessageThreadPoolQueueCapacity
;
}
public
boolean
isAclEnable
()
{
return
aclEnable
;
}
public
void
setAclEnable
(
boolean
aclEnable
)
{
this
.
aclEnable
=
aclEnable
;
}
}
snode/src/main/java/org/apache/rocketmq/snode/SnodeController.java
浏览文件 @
bd21a92d
...
...
@@ -325,7 +325,7 @@ public class SnodeController {
}
p
ublic
void
registerProcessor
()
{
p
rivate
void
registerProcessor
()
{
if
(
snodeServer
!=
null
)
{
this
.
snodeServer
.
registerProcessor
(
RequestCode
.
SEND_MESSAGE_V2
,
sendMessageProcessor
,
this
.
sendMessageExecutor
);
this
.
snodeServer
.
registerProcessor
(
RequestCode
.
CONSUMER_SEND_MSG_BACK
,
sendMessageProcessor
,
this
.
sendMessageExecutor
);
...
...
@@ -333,6 +333,7 @@ public class SnodeController {
this
.
snodeServer
.
registerProcessor
(
RequestCode
.
UNREGISTER_CLIENT
,
heartbeatProcessor
,
this
.
heartbeatExecutor
);
this
.
snodeServer
.
registerProcessor
(
RequestCode
.
CHECK_CLIENT_CONFIG
,
heartbeatProcessor
,
this
.
heartbeatExecutor
);
this
.
snodeServer
.
registerProcessor
(
RequestCode
.
PULL_MESSAGE
,
pullMessageProcessor
,
this
.
pullMessageExecutor
);
this
.
snodeServer
.
registerProcessor
(
RequestCode
.
SNODE_PULL_MESSAGE
,
pullMessageProcessor
,
this
.
pullMessageExecutor
);
this
.
snodeServer
.
registerProcessor
(
RequestCode
.
GET_CONSUMER_LIST_BY_GROUP
,
consumerManageProcessor
,
this
.
consumerManageExecutor
);
this
.
snodeServer
.
registerProcessor
(
RequestCode
.
UPDATE_CONSUMER_OFFSET
,
consumerManageProcessor
,
this
.
consumerManageExecutor
);
this
.
snodeServer
.
registerProcessor
(
RequestCode
.
QUERY_CONSUMER_OFFSET
,
consumerManageProcessor
,
this
.
consumerManageExecutor
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录