Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-09-22 15:10:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b5ccc35340785f02e441d20a93d0dd91c70e365b
b5ccc353
1 parent
ab1e62a8
add kafka config
显示空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
47 行增加
和
1 行删除
trunk/conf/full.conf
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/conf/full.conf
查看文件 @
b5ccc35
...
...
@@ -231,6 +231,18 @@ stream_caster {
}
#############################################################################################
# Kafka sections
#############################################################################################
# Apache Kafka is a high-throughput distributed messaging system.
# SRS is a Kafka producer to send message to kafka.
# @see https://kafka.apache.org/documentation.html#introduction
kafka
{
# whether enabled kafka.
# default: off
enabled
off
;
}
#############################################################################################
# RTMP/HTTP VHOST sections
#############################################################################################
# vhost list, the __defaultVhost__ is the default vhost
...
...
trunk/src/app/srs_app_config.cpp
查看文件 @
b5ccc35
...
...
@@ -3488,7 +3488,7 @@ int SrsConfig::check_config()
&&
n
!=
"srs_log_tank"
&&
n
!=
"srs_log_level"
&&
n
!=
"srs_log_file"
&&
n
!=
"max_connections"
&&
n
!=
"daemon"
&&
n
!=
"heartbeat"
&&
n
!=
"http_api"
&&
n
!=
"stats"
&&
n
!=
"vhost"
&&
n
!=
"pithy_print_ms"
&&
n
!=
"http_server"
&&
n
!=
"stream_caster"
&&
n
!=
"http_server"
&&
n
!=
"stream_caster"
&&
n
!=
"kafka"
&&
n
!=
"utc_time"
)
{
ret
=
ERROR_SYSTEM_CONFIG_INVALID
;
...
...
@@ -3531,6 +3531,17 @@ int SrsConfig::check_config()
}
}
if
(
true
)
{
SrsConfDirective
*
conf
=
root
->
get
(
"kafka"
);
for
(
int
i
=
0
;
conf
&&
i
<
(
int
)
conf
->
directives
.
size
();
i
++
)
{
string
n
=
conf
->
at
(
i
)
->
name
;
if
(
n
!=
"enabled"
)
{
ret
=
ERROR_SYSTEM_CONFIG_INVALID
;
srs_error
(
"unsupported kafka directive %s, ret=%d"
,
n
.
c_str
(),
ret
);
return
ret
;
}
}
}
if
(
true
)
{
SrsConfDirective
*
conf
=
get_heartbeart
();
for
(
int
i
=
0
;
conf
&&
i
<
(
int
)
conf
->
directives
.
size
();
i
++
)
{
string
n
=
conf
->
at
(
i
)
->
name
;
...
...
@@ -4243,6 +4254,23 @@ int SrsConfig::get_stream_caster_rtp_port_max(SrsConfDirective* conf)
return
::
atoi
(
conf
->
arg0
().
c_str
());
}
bool
SrsConfig
::
get_kafka_enabled
()
{
static
bool
DEFAULT
=
false
;
SrsConfDirective
*
conf
=
root
->
get
(
"kafka"
);
if
(
!
conf
)
{
return
DEFAULT
;
}
conf
=
conf
->
get
(
"enabled"
);
if
(
!
conf
||
conf
->
arg0
().
empty
())
{
return
DEFAULT
;
}
return
SRS_CONF_PERFER_FALSE
(
conf
->
arg0
());
}
SrsConfDirective
*
SrsConfig
::
get_vhost
(
string
vhost
,
bool
try_default_vhost
)
{
srs_assert
(
root
);
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
b5ccc35
...
...
@@ -628,6 +628,12 @@ public:
* get the max udp port for rtp of stream caster rtsp.
*/
virtual
int
get_stream_caster_rtp_port_max
(
SrsConfDirective
*
conf
);
// kafka section.
public:
/**
* whether the kafka enabled.
*/
virtual
bool
get_kafka_enabled
();
// vhost specified section
public:
/**
...
...
请
注册
或
登录
后发表评论