Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
pulsar
提交
3f39a61d
pulsar
项目概览
apache
/
pulsar
通知
129
Star
40
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
pulsar
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
3f39a61d
编写于
6月 20, 2017
作者:
N
nkurihar
提交者:
Matteo Merli
6月 20, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add connectionsPerBroker setting to WebSocket proxy (#497)
上级
a45ffe25
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
60 addition
and
6 deletion
+60
-6
conf/broker.conf
conf/broker.conf
+11
-3
conf/standalone.conf
conf/standalone.conf
+11
-0
conf/websocket.conf
conf/websocket.conf
+6
-0
pulsar-broker-common/src/main/java/com/yahoo/pulsar/broker/ServiceConfiguration.java
...in/java/com/yahoo/pulsar/broker/ServiceConfiguration.java
+14
-0
pulsar-websocket/src/main/java/com/yahoo/pulsar/websocket/WebSocketService.java
...ain/java/com/yahoo/pulsar/websocket/WebSocketService.java
+5
-1
pulsar-websocket/src/main/java/com/yahoo/pulsar/websocket/service/WebSocketProxyConfiguration.java
...pulsar/websocket/service/WebSocketProxyConfiguration.java
+13
-2
未找到文件。
conf/broker.conf
浏览文件 @
3f39a61d
...
...
@@ -34,9 +34,6 @@ webServicePort=8080
# Port to use to server HTTPS request
webServicePortTls
=
8443
# Enable the WebSocket API service in broker
webSocketServiceEnabled
=
false
# Hostname or IP address the service binds on, default is 0.0.0.0.
bindAddress
=
0
.
0
.
0
.
0
...
...
@@ -320,3 +317,14 @@ brokerServicePurgeInactiveFrequencyInSeconds=60
# Name of load manager to use
loadManagerClassName
=
com
.
yahoo
.
pulsar
.
broker
.
loadbalance
.
impl
.
SimpleLoadManagerImpl
### --- WebSocket --- ###
# Enable the WebSocket API service in broker
webSocketServiceEnabled
=
false
# Number of IO threads in Pulsar Client used in WebSocket proxy
webSocketNumIoThreads
=
8
# Number of connections per Broker in Pulsar Client used in WebSocket proxy
webSocketConnectionsPerBroker
=
8
conf/standalone.conf
浏览文件 @
3f39a61d
...
...
@@ -268,3 +268,14 @@ keepAliveIntervalSeconds=30
# How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected)
brokerServicePurgeInactiveFrequencyInSeconds
=
60
### --- WebSocket --- ###
# Enable the WebSocket API service in broker
webSocketServiceEnabled
=
true
# Number of IO threads in Pulsar Client used in WebSocket proxy
webSocketNumIoThreads
=
8
# Number of connections per Broker in Pulsar Client used in WebSocket proxy
webSocketConnectionsPerBroker
=
8
conf/websocket.conf
浏览文件 @
3f39a61d
...
...
@@ -39,6 +39,12 @@ bindAddress=0.0.0.0
# Name of the pulsar cluster to connect to
clusterName
=
# Number of IO threads in Pulsar Client used in WebSocket proxy
numIoThreads
=
8
# Number of connections per Broker in Pulsar Client used in WebSocket proxy
connectionsPerBroker
=
8
### --- Authentication --- ###
# Enable authentication
...
...
pulsar-broker-common/src/main/java/com/yahoo/pulsar/broker/ServiceConfiguration.java
浏览文件 @
3f39a61d
...
...
@@ -280,6 +280,12 @@ public class ServiceConfiguration implements PulsarConfiguration {
@FieldContext
(
dynamic
=
true
)
private
boolean
preferLaterVersions
=
false
;
/**** --- WebSocket --- ****/
// Number of IO threads in Pulsar Client used in WebSocket proxy
private
int
webSocketNumIoThreads
=
Runtime
.
getRuntime
().
availableProcessors
();
// Number of connections per Broker in Pulsar Client used in WebSocket proxy
private
int
webSocketConnectionsPerBroker
=
Runtime
.
getRuntime
().
availableProcessors
();
public
String
getZookeeperServers
()
{
return
zookeeperServers
;
}
...
...
@@ -1019,4 +1025,12 @@ public class ServiceConfiguration implements PulsarConfiguration {
public
void
setPreferLaterVersions
(
boolean
preferLaterVersions
)
{
this
.
preferLaterVersions
=
preferLaterVersions
;
}
public
int
getWebSocketNumIoThreads
()
{
return
webSocketNumIoThreads
;
}
public
void
setWebSocketNumIoThreads
(
int
webSocketNumIoThreads
)
{
this
.
webSocketNumIoThreads
=
webSocketNumIoThreads
;
}
public
int
getWebSocketConnectionsPerBroker
()
{
return
webSocketConnectionsPerBroker
;
}
public
void
setWebSocketConnectionsPerBroker
(
int
webSocketConnectionsPerBroker
)
{
this
.
webSocketConnectionsPerBroker
=
webSocketConnectionsPerBroker
;
}
}
pulsar-websocket/src/main/java/com/yahoo/pulsar/websocket/WebSocketService.java
浏览文件 @
3f39a61d
...
...
@@ -176,7 +176,9 @@ public class WebSocketService implements Closeable {
clientConf
.
setUseTls
(
config
.
isTlsEnabled
());
clientConf
.
setTlsAllowInsecureConnection
(
config
.
isTlsAllowInsecureConnection
());
clientConf
.
setTlsTrustCertsFilePath
(
config
.
getTlsTrustCertsFilePath
());
clientConf
.
setIoThreads
(
WebSocketProxyConfiguration
.
PULSAR_CLIENT_IO_THREADS
);
clientConf
.
setIoThreads
(
config
.
getWebSocketNumIoThreads
());
clientConf
.
setConnectionsPerBroker
(
config
.
getWebSocketConnectionsPerBroker
());
if
(
config
.
isAuthenticationEnabled
())
{
clientConf
.
setAuthentication
(
config
.
getBrokerClientAuthenticationPlugin
(),
config
.
getBrokerClientAuthenticationParameters
());
...
...
@@ -223,6 +225,8 @@ public class WebSocketService implements Closeable {
serviceConfig
.
setTlsCertificateFilePath
(
config
.
getTlsCertificateFilePath
());
serviceConfig
.
setTlsKeyFilePath
(
config
.
getTlsKeyFilePath
());
serviceConfig
.
setTlsAllowInsecureConnection
(
config
.
isTlsAllowInsecureConnection
());
serviceConfig
.
setWebSocketNumIoThreads
(
config
.
getNumIoThreads
());
serviceConfig
.
setWebSocketConnectionsPerBroker
(
config
.
getConnectionsPerBroker
());
return
serviceConfig
;
}
...
...
pulsar-websocket/src/main/java/com/yahoo/pulsar/websocket/service/WebSocketProxyConfiguration.java
浏览文件 @
3f39a61d
...
...
@@ -30,8 +30,6 @@ public class WebSocketProxyConfiguration implements PulsarConfiguration {
public
static
final
int
WEBSOCKET_SERVICE_THREADS
=
20
;
// Number of threads used by Global ZK
public
static
final
int
GLOBAL_ZK_THREADS
=
8
;
// Number of IO threads in Pulsar Client
public
static
final
int
PULSAR_CLIENT_IO_THREADS
=
Runtime
.
getRuntime
().
availableProcessors
();
// Name of the cluster to which this broker belongs to
@FieldContext
(
required
=
true
)
...
...
@@ -69,6 +67,11 @@ public class WebSocketProxyConfiguration implements PulsarConfiguration {
private
String
brokerClientAuthenticationPlugin
;
private
String
brokerClientAuthenticationParameters
;
// Number of IO threads in Pulsar Client used in WebSocket proxy
private
int
numIoThreads
=
Runtime
.
getRuntime
().
availableProcessors
();
// Number of connections per Broker in Pulsar Client used in WebSocket proxy
private
int
connectionsPerBroker
=
Runtime
.
getRuntime
().
availableProcessors
();
/***** --- TLS --- ****/
// Enable TLS
private
boolean
tlsEnabled
=
false
;
...
...
@@ -211,6 +214,14 @@ public class WebSocketProxyConfiguration implements PulsarConfiguration {
this
.
brokerClientAuthenticationParameters
=
brokerClientAuthenticationParameters
;
}
public
int
getNumIoThreads
()
{
return
numIoThreads
;
}
public
void
setNumIoThreads
(
int
numIoThreads
)
{
this
.
numIoThreads
=
numIoThreads
;
}
public
int
getConnectionsPerBroker
()
{
return
connectionsPerBroker
;
}
public
void
setConnectionsPerBroker
(
int
connectionsPerBroker
)
{
this
.
connectionsPerBroker
=
connectionsPerBroker
;
}
public
boolean
isTlsEnabled
()
{
return
tlsEnabled
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录