41
41
42
42
typedef struct ngx_http_json_log_main_conf_s ngx_http_json_log_main_conf_t ;
43
43
44
- #ifdef HTTP_JSON_LOG_KAFKA_ENABLED
44
+ #if ( NGX_HAVE_LIBRDKAFKA )
45
45
/* configuration kafka constants */
46
46
static ngx_int_t http_json_log_filter_has_kafka_locations = NGX_CONF_UNSET ;
47
47
#endif
@@ -59,7 +59,7 @@ typedef struct ngx_http_json_log_resp_headers_s
59
59
/* main config */
60
60
struct ngx_http_json_log_filter_main_conf_s {
61
61
ngx_array_t * formats ;
62
- #ifdef HTTP_JSON_LOG_KAFKA_ENABLED
62
+ #if ( NGX_HAVE_LIBRDKAFKA )
63
63
ngx_json_log_main_kafka_conf_t kafka ;
64
64
#endif
65
65
};
@@ -123,7 +123,7 @@ static ngx_command_t ngx_http_json_log_filter_commands[] = {
123
123
0 ,
124
124
NULL
125
125
},
126
- #ifdef HTTP_JSON_LOG_KAFKA_ENABLED
126
+ #if ( NGX_HAVE_LIBRDKAFKA )
127
127
/* KAFKA */
128
128
{
129
129
ngx_string ("json_err_log_kafka_client_id" ),
@@ -322,7 +322,7 @@ ngx_http_json_log_header_bad_request(ngx_http_request_t *r) {
322
322
323
323
ngx_str_t payload ;
324
324
325
- #ifdef HTTP_JSON_LOG_KAFKA_ENABLED
325
+ #if ( NGX_HAVE_LIBRDKAFKA )
326
326
ngx_str_t msg_id ;
327
327
int err ;
328
328
ngx_http_json_log_filter_main_conf_t * mcf ;
@@ -375,7 +375,7 @@ ngx_http_json_log_header_bad_request(ngx_http_request_t *r) {
375
375
}
376
376
}
377
377
378
- #ifdef HTTP_JSON_LOG_KAFKA_ENABLED
378
+ #if ( NGX_HAVE_LIBRDKAFKA )
379
379
mcf = ngx_http_get_module_main_conf (r , ngx_http_json_log_filter_module );
380
380
#endif
381
381
@@ -425,7 +425,7 @@ ngx_http_json_log_header_bad_request(ngx_http_request_t *r) {
425
425
continue ;
426
426
}
427
427
428
- #ifdef HTTP_JSON_LOG_KAFKA_ENABLED
428
+ #if ( NGX_HAVE_LIBRDKAFKA )
429
429
/* Write to kafka */
430
430
if (location -> type == NGX_JSON_LOG_SINK_KAFKA ) {
431
431
@@ -702,7 +702,7 @@ ngx_http_json_log_filter_create_main_conf(ngx_conf_t *cf) {
702
702
return NULL ;
703
703
}
704
704
705
- #ifdef HTTP_JSON_LOG_KAFKA_ENABLED
705
+ #if ( NGX_HAVE_LIBRDKAFKA )
706
706
if (ngx_json_log_init_kafka (cf -> pool , & conf -> kafka ) != NGX_OK ) {
707
707
ngx_conf_log_error (NGX_LOG_EMERG , cf , 0 ,
708
708
"http_json_log: error initialize kafka conf" );
@@ -810,7 +810,7 @@ ngx_http_json_log_srv_output(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) {
810
810
new_location = ngx_array_push (lc -> locations );
811
811
new_location -> type = NGX_JSON_LOG_SINK_FILE ;
812
812
prefix_len = NGX_JSON_LOG_FILE_OUT_LEN ;
813
- #ifdef HTTP_JSON_LOG_KAFKA_ENABLED
813
+ #if ( NGX_HAVE_LIBRDKAFKA )
814
814
}
815
815
else if (NGX_JSON_LOG_HAS_KAFKA_PREFIX (value )) {
816
816
new_location = ngx_array_push (lc -> locations );
@@ -841,7 +841,7 @@ ngx_http_json_log_srv_output(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) {
841
841
& new_location -> location );
842
842
}
843
843
844
- #ifdef HTTP_JSON_LOG_KAFKA_ENABLED
844
+ #if ( NGX_HAVE_LIBRDKAFKA )
845
845
/* If sink type is kafka, then set topic config for this location */
846
846
if (new_location -> type == NGX_JSON_LOG_SINK_KAFKA ) {
847
847
@@ -892,7 +892,7 @@ ngx_http_json_log_srv_output(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) {
892
892
static ngx_int_t
893
893
ngx_http_json_log_filter_init_worker (ngx_cycle_t * cycle ) {
894
894
895
- #ifdef HTTP_JSON_LOG_KAFKA_ENABLED
895
+ #if ( NGX_HAVE_LIBRDKAFKA )
896
896
ngx_int_t rc = NGX_OK ;
897
897
ngx_http_json_log_filter_main_conf_t * conf =
898
898
ngx_http_cycle_get_module_main_conf (cycle ,
0 commit comments