본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Kafka Consume Policy 구성 참조

원문 보기 위키 갱신

Kafka Consume Policy 구성 참조 (Kafka Consume Policy Configuration Reference)

이 문서는 Kong AI Gateway에서 Kafka 메시지를 소비하기 위한 정책의 구성 속성을 상세히 설명해요. topics, schema_registry, 인증 설정 등을 JSON 스키마로 정의하고 있어요. Kafka Consume Policy를 설정할 때 필요한 모든 파라미터를 참조할 수 있어요.

출처: 문서

본문

다음은 Kong 문서의 한 조각이에요. 규칙대로 번역하세요.

{
  "properties": {
    "config": {
      "type": "object",
      "properties": {
        "topics": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "schema_registry": {
                "type": "object",
                "properties": {
                  "confluent": {
                    "type": "object",
                    "properties": {
                      "ssl_verify": {
                        "type": "boolean",
                        "description": "Set to false to disable SSL certificate verification when connecting to the schema registry.",
                        "default": true
                      },
                      "authentication": {
                        "type": "object",
                        "properties": {
                          "oauth2_client": {
                            "type": "object",
                            "properties": {
                              "https_proxy_authorization": {
                                "type": "string",
                                "description": "The `Proxy-Authorization` header value to be used with `https_proxy`."
                              },
                              "ssl_verify": {
                                "type": "boolean",
                                "description": "Whether to verify the certificate presented by the IdP when using HTTPS.",
                                "default": true
                              },
                              "client_secret_jwt_alg": {
                                "type": "string",
                                "enum": [
                                  "HS256",
                                  "HS512"
                                ],
                                "description": "The algorithm to use with JWT when using `client_secret_jwt` authentication.",
                                "default": "HS512"
                              },
                              "https_proxy": {
                                "type": "string",
                                "description": "The proxy to use when making HTTPS requests to the IdP."
                              },
                              "no_proxy": {
                                "type": "string",
                                "description": "A comma-separated list of hosts that should not be proxied."
                              },
                              "timeout": {
                                "type": "integer",
                                "maximum": 2147483646,
                                "minimum": 0,
                                "description": "Network I/O timeout for requests to the IdP in milliseconds.",
                                "default": 10000
                              },
                              "keep_alive": {
                                "type": "boolean",
                                "description": "Whether to use keepalive connections to the IdP.",
                                "default": true
                              },
                              "auth_method": {
                                "type": "string",
                                "enum": [
                                  "client_secret_basic",
                                  "client_secret_jwt",
                                  "client_secret_post",
                                  "none"
                                ],
                                "description": "The authentication method used in client requests to the IdP. Supported values are: `client_secret_basic` to send `client_id` and `client_secret` in the `Authorization: Basic` header, `client_secret_post` to send `client_id` and `client_secret` as part of the request body, or `client_secret_jwt` to send a JWT signed with the `client_secret` using the client assertion as part of the body.",
                                "default": "client_secret_post"
                              },
                              "http_version": {
                                "type": "number",
                                "description": "The HTTP version used for requests made by this policy. Supported values: `1.1` for HTTP 1.1 and `1.0` for HTTP 1.0.",
                                "default": 1.1
                              },
                              "http_proxy": {
                                "type": "string",
                                "description": "The proxy to use when making HTTP requests to the IdP."
                              },
                              "http_proxy_authorization": {
                                "type": "string",
                                "description": "The `Proxy-Authorization` header value to be used with `http_proxy`."
                              }
                            }
                          },
                          "mode": {
                            "type": "string",
                            "enum": [
                              "basic",
                              "none",
                              "oauth2"
                            ],
                            "description": "Authentication mode to use with the schema registry.",
                            "default": "none"
                          },
                          "basic": {
                            "type": "object",
                            "properties": {
                              "username": {
                                "type": "string",
                                "x-referenceable": true,
                                "x-encrypted": true
                              },
                              "password": {
                                "type": "string",
                                "x-referenceable": true,
                                "x-encrypted": true
                              }
                            },
                            "required": [
                              "password",
                              "username"
                            ]
                          },
                          "oauth2": {
                            "type": "object",
                            "properties": {
                              "grant_type": {
                                "type": "string",
                                "enum": [
                                  "client_credentials",
                                  "password"
                                ],
                                "description": "The OAuth grant type to be used.",
                                "default": "client_credentials"
                              },
                              "client_secret": {
                                "type": "string",
                                "description": "The client secret for the application registration in the IdP.",
                                "x-referenceable": true,
                                "x-encrypted": true
                              },
                              "password": {
                                "type": "string",
                                "description": "The password to use if `config.oauth.grant_type` is set to `password`.",
                                "x-referenceable": true,
                                "x-encrypted": true
                              },
                              "scopes": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                },
                                "description": "List of scopes to request from the IdP when obtaining a new token.",
                                "default": [
                                  "openid"
                                ]
                              },
                              "audience": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                },
                                "description": "List of audiences passed to the IdP when obtaining a new token.",
                                "default": []
                              },
                              "client_id": {
                                "type": "string",
                                "description": "The client ID for the application registration in the IdP.",
                                "x-referenceable": true,
                                "x-encrypted": true
                              },
                              "username": {
                                "type": "string",
                                "description": "The username to use if `config.oauth.grant_type` is set to `password`.",
                                "x-encrypted": true,
                                "x-referenceable": true
                              },
                              "token_endpoint": {
                                "type": "string",
                                "description": "The token endpoint URI."
                              },
                              "token_headers": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "string",
                                  "x-referenceable": true
                                },
                                "description": "Extra headers to be passed in the token endpoint request."
                              },
                              "token_post_args": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "string",
                                  "x-referenceable": true
                                },
                                "description": "Extra post arguments to be passed in the token endpoint request."
                              }
                            },
                            "required": [
                              "token_endpoint"
                            ]
                          }
                        }
                      },
                      "url": {
                        "type": "string",
                        "description": "The URL of the schema registry."
                      },
                      "ttl": {
                        "type": "number",
                        "maximum": 3600,
                        "minimum": 0,
                        "description": "The TTL in seconds for the schema registry cache."
                      }
                    }
                  }
                },
                "description": "The plugin-global schema registry configuration."
              }
            },
            "required": [
              "name"
            ]
          },
          "minLength": 1,
          "description": "The Kafka topics and their configuration you want to consume from."
        },
        "schema_registry": {
          "type": "object",
          "properties": {
            "confluent": {
              "type": "object",
              "properties": {
                "ssl_verify": {
                  "type": "boolean",
                  "description": "Set to false to disable SSL certificate verification when connecting to the schema registry.",
                  "default": true
                },
                "authentication": {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "basic",
                        "none",
                        "oauth2"
                      ],
                      "description": "Authentication mode to use with the schema registry.",
                      "default": "none"
                    },
                    "basic": {
                      "type": "object",
                      "properties": {
                        "username": {
                          "type": "string",
                          "x-referenceable": true,
                          "x-encrypted": true
                        },
                        "password": {
                          "type": "string",
                          "x-referenceable": true,
                          "x-encrypted": true
                        }
                      },
                      "required": [
                        "password",
                        "username"
                      ]
                    },
                    "oauth2": {
                      "type": "object",
                      "properties": {
                        "token_headers": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string",
                            "x-referenceable": true
                          },
                          "description": "Extra headers to be passed in the token endpoint request."
                        },
                        "token_post_args": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string",
                            "x-referenceable": true
                          },
                          "description": "Extra post arguments to be passed in the token endpoint request."
                        },
                        "username": {
                          "type": "string",
                          "description": "The username to use if `config.oauth.grant_type` is set to `password`.",
                          "x-referenceable": true,
                          "x-encrypted": true
                        },
                        "password": {
                          "type": "string",
                          "description": "The password to use if `config.oauth.grant_type` is set to `password`.",
                          "x-referenceable": true,
                          "x-encrypted": true
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "List of scopes to request from the IdP when obtaining a new token.",
                          "default": [
                            "openid"
                          ]
                        },
                        "grant_type": {
                          "type": "string",
                          "enum": [
                            "client_credentials",
                            "password"
                          ],
                          "description": "The OAuth grant type to be used.",
                          "default": "client_credentials"
                        },
                        "client_id": {
                          "type": "string",
                          "description": "The client ID for the application registration in the IdP.",
                          "x-encrypted": true,
                          "x-referenceable": true
                        },
                        "client_secret": {
                          "type": "string",
                          "description": "The client secret for the application registration in the IdP.",
                          "x-referenceable": true,
                          "x-encrypted": true
                        },
                        "audience": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "List of audiences passed to the IdP when obtaining a new token.",
                          "default": []
                        },
                        "token_endpoint": {
                          "type": "string",
                          "description": "The token endpoint URI."
                        }
                      },
                      "required": [
                        "token_endpoint"
                      ]
                    },
                    "oauth2_client": {
                      "type": "object",
                      "properties": {
                        "ssl_verify": {
                          "type": "boolean",
                          "description": "Whether to verify the certificate presented by the IdP when using HTTPS.",
                          "default": true
                        },
                        "auth_method": {
                          "type": "string",
                          "enum": [
                            "client_secret_basic",
                            "client_secret_jwt",
                            "client_secret_post",
                            "none"
                          ],
                          "description": "The authentication method used in client requests to the IdP. Supported values are: `client_secret_basic` to send `client_id` and `client_secret` in the `Authorization: Basic` header, `client_secret_post` to send `client_id` and `client_secret` as part of the request body, or `client_secret_jwt` to send a JWT signed with the `client_secret` using the client assertion as part of the body.",
                          "default": "client_secret_post"
                        },
                        "http_version": {
                          "type": "number",
                          "description": "The HTTP version used for requests made by this policy. Supported values: `1.1` for HTTP 1.1 and `1.0` for HTTP 1.0.",
                          "default": 1.1
                        },
                        "http_proxy": {
                          "type": "string",
                          "description": "The proxy to use when making HTTP requests to the IdP."
                        },
                        "http_proxy_authorization": {
                          "type": "string",
                          "description": "The `Proxy-Authorization` header value to be used with `http_proxy`."
                        },
                        "https_proxy": {
                          "type": "string",
                          "description": "The proxy to use when making HTTPS requests to the IdP."
                        },
                        "https_proxy_authorization": {
                          "type": "string",
                          "description": "The `Proxy-Authorization` header value to be used with `https_proxy`."
                        },
                        "keep_alive": {
                          "type": "boolean",
                          "description": "Whether to use keepalive connections to the IdP.",
                          "default": true
                        },
                        "client_secret_jwt_alg": {
                          "type": "string",
                          "enum": [
                            "HS256",
                            "HS512"
                          ],
                          "description": "The algorithm to use with JWT when using `client_secret_jwt` authentication.",
                          "default": "HS512"
                        },
                        "no_proxy": {
                          "type": "string",
                          "description": "A comma-separated list of hosts that should not be proxied."
                        },
                        "timeout": {
                          "type": "integer",
                          "maximum": 2147483646,
                          "minimum": 0,
                          "description": "Network I/O timeout for requests to the IdP in milliseconds.",
                          "default": 10000
                        }
                      }
                    }
                  }
                },
                "url": {
                  "type": "string",
                  "description": "The URL of the schema registry."
                },
                "ttl": {
                  "type": "number",
                  "maximum": 3600,
                  "minimum": 0,
                  "description": "The TTL in seconds for the schema registry cache."
                }
              }
            }
          },
          "description": "The plugin-global schema registry configuration."
        },
        "mode": {
          "type": "string",
          "enum": [
            "http-get",
            "server-sent-events",
            "websocket"
          ],
          "description": "The mode of operation for the policy.",
          "default": "http-get"
        },
        "message_deserializer": {
          "type": "string",
          "enum": [
            "json",
            "noop"
          ],
          "description": "The deserializer to use for the consumed messages.",
          "default": "noop"
        },
        "auto_offset_reset": {
          "type": "string",
          "enum": [
            "earliest",
            "latest"
          ],
          "description": "The offset to start from when there is no initial offset in the consumer group.",
          "default": "latest"
        },
        "commit_strategy": {
          "type": "string",
          "enum": [
            "auto",
            "off"
          ],
          "description": "The strategy to use for committing offsets.",
          "default": "auto"
        },
        "enforce_latest_offset_reset": {
          "type": "boolean",
          "description": "When true, 'latest' offset reset behaves correctly (starts from end). When false (default), maintains backwards compatibility where 'latest' acts like 'earliest'.",
          "default": false
        },
        "security": {
          "type": "object",
          "properties": {
            "certificate_id": {
              "type": "string",
              "description": "UUID of certificate entity for mTLS authentication."
            },
            "ssl": {
              "type": "boolean",
              "description": "Enables TLS."
            },
            "ssl_verify": {
              "type": "boolean",
              "description": "When using TLS, this option enables verification of the certificate presented by the server.",
              "default": true
            }
          }
        },
        "bootstrap_servers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "host": {
                "type": "string",
                "description": "A string representing a host name, such as example.com."
              },
              "port": {
                "type": "integer",
                "maximum": 65535,
                "minimum": 0,
                "description": "An integer representing a port number between 0 and 65535, inclusive."
              }
            },
            "required": [
              "host",
              "port"
            ]
          },
          "description": "Set of bootstrap brokers in a `{host: host, port: port}` list format."
        },
        "authentication": {
          "type": "object",
          "properties": {
            "strategy": {
              "type": "string",
              "enum": [
                "sasl"
              ],
              "description": "The authentication strategy for the policy, the only option for the value is `sasl`."
            },
            "mechanism": {
              "type": "string",
              "enum": [
                "PLAIN",
                "SCRAM-SHA-256",
                "SCRAM-SHA-512"
              ],
              "description": "The SASL authentication mechanism.  Supported options: `PLAIN` or `SCRAM-SHA-256`."
            },
            "tokenauth": {
              "type": "boolean",
              "description": "Enable this to indicate `DelegationToken` authentication"
            },
            "user": {
              "type": "string",
              "description": "Username for SASL authentication.",
              "x-encrypted": true,
              "x-referenceable": true
            },
            "password": {
              "type": "string",
              "description": "Password for SASL authentication.",
              "x-referenceable": true,
              "x-encrypted": true
            }
          }
        },
        "cluster_name": {
          "type": "string",
          "description": "An identifier for the Kafka cluster."
        },
        "message_by_lua_functions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The Lua functions that manipulates the message being sent to the client."
        },
        "enable_dlq": {
          "type": "boolean",
          "description": "Enables Dead Letter Queue. When enabled, if the message doesn't conform to the schema (from Schema Registry) or there's an error in the `message_by_lua_functions`, it will be forwarded to `dlq_topic` that can be processed later."
        },
        "dlq_topic": {
          "type": "string",
          "description": "The topic to use for the Dead Letter Queue."
        }
      },
      "required": [
        "bootstrap_servers",
        "topics"
      ]
    }
  }
}

다음은 Kong 문서의 한 조각이야. 규칙대로 번역해라.

관련 리소스

더 알아보기 (Learn more)