Skip to content

Commit

Permalink
Add schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdnk committed Oct 23, 2024
1 parent 4c04707 commit 92f3460
Showing 1 changed file with 288 additions and 0 deletions.
288 changes: 288 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
{
"$id": "https://raw.githubusercontent.com/roadrunner-server/kafka/refs/heads/master/schema.json",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"title": "roadrunner-kafka",
"description": "The schema contains all the valid configuration parameters for the Kafka plugin for the roadrunner job system.",
"definitions": {
"pipeline": {
"type": "object",
"required": [
"driver"
],
"additionalProperties": false,
"properties": {
"driver": {
"type": "string",
"enum": [
"kafka"
]
},
"config": {
"type": "object",
"description": "Configuration for Kafka driver.",
"additionalProperties": false,
"properties": {
"priority": {
"$ref": "https://raw.githubusercontent.com/roadrunner-server/jobs/refs/heads/master/schema.json#/definitions/PipelineProperties/priority"
},
"auto_create_topics_enable": {
"description": "Auto create topic for the consumer/producer",
"type": "boolean",
"default": false
},
"producer_options": {
"description": "Kafka producer options",
"type": "object",
"properties": {
"disable_idempotent": {
"description": "Disable_idempotent disables idempotent produce requests, opting out of Kafka server-side deduplication in the face of reissued requests due to transient network problems. Idempotent production is strictly a win, but does require the IDEMPOTENT_WRITE permission on CLUSTER (pre Kafka 3.0), and not all clients can have that permission.",
"type": "boolean",
"default": false
},
"required_acks": {
"description": "Sets the required acks for produced records",
"type": "string",
"default": "AllISRAcks",
"enum": [
"NoAck",
"LeaderAck",
"AllISRAck"
]
},
"max_message_bytes": {
"type": "integer",
"default": 1000012,
"minimum": 0
},
"request_timeout": {
"description": "The maximum duration in seconds the broker will wait the receipt of the number of required_acks.",
"$ref": "https://raw.githubusercontent.com/roadrunner-server/roadrunner/refs/heads/master/schemas/config/3.0.schema.json#/definitions/Duration"
},
"compression_codec": {
"type": "string",
"default": "none",
"enum": [
"none",
"gzip",
"snappy",
"lz4",
"zstd"
]
},
"delivery_timeout": {
"description": "A rough duration of how long a record can sit around in a batch before timing out, overriding the unlimited default.",
"$ref": "https://raw.githubusercontent.com/roadrunner-server/roadrunner/refs/heads/master/schemas/config/3.0.schema.json#/definitions/Duration"
},
"transaction_timeout": {
"description": "The allowed duration for a transaction. It is a good idea to keep this less than a group's session timeout.",
"$ref": "https://raw.githubusercontent.com/roadrunner-server/roadrunner/refs/heads/master/schemas/config/3.0.schema.json#/definitions/Duration"
}
}
},
"group_options": {
"type": "object",
"description": "group_options sets the consumer group for the client to join and consume in. This option is required if using any other group options.",
"properties": {
"group_id": {
"description": "Kafka group ID",
"type": "string"
},
"block_rebalance_on_poll": {
"description": "Switches the client to block rebalances whenever you poll",
"type": "boolean",
"default": false
}
}
},
"consumer_options": {
"description": "Kafka consumer options",
"type": "object",
"properties": {
"topics": {
"description": "List of the topics to consume. Regex also supported.",
"type": "array",
"items": {
"type": "string"
}
},
"consume_regexp": {
"description": "consume_regexp sets the client to parse all topics passed to `topics` as regular expressions. When consuming via regex, every metadata request loads *all* topics, so that all topics can be passed to any regular expressions. Every topic is evaluated only once ever across all regular expressions; either it permanently is known to match, or is permanently known to not match.",
"type": "boolean",
"default": false
},
"max_fetch_message_size": {
"type": "integer",
"default": 50000
},
"min_fetch_message_size": {
"type": "integer",
"default": 1
},
"consume_offset": {
"description": "consumer_offset sets the offset to start consuming from, or if OffsetOutOfRange is seen while fetching, to restart consuming from.",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"description": "Partition offset type",
"type": "string",
"enum": [
"AtEnd",
"At",
"AfterMilli",
"AtStart",
"Relative",
"WithEpoch"
]
},
"value": {
"description": "Value for the: At, AfterMilli, Relative and WithEpoch offsets",
"type": "integer",
"default": 0
}
}
},
"consume_partitions": {
"type": "object",
"minProperties": 1,
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"description": "Topic to consume",
"type": "object",
"minProperties": 1,
"patternProperties": {
"^[0-9]+$": {
"type": "object",
"description": "Partition number.",
"required": [
"type"
],
"properties": {
"type": {
"description": "Partition offset type",
"type": "string",
"enum": [
"AtEnd",
"At",
"AfterMilli",
"AtStart",
"Relative",
"WithEpoch"
]
},
"value": {
"description": "Value for the: At, AfterMilli, Relative and WithEpoch offsets",
"type": "integer",
"default": 0
}
}
}
}
}
}
}
}
}
}
}
}
},
"driver": {
"type": "object",
"additionalProperties": false,
"description": "Configuration options for the Kafka driver.",
"properties": {
"brokers": {
"description": "Kafka broker addresses.",
"type": "array",
"items": {
"type": "string",
"enum": [
"127.0.0.1:9092",
"127.0.0.1:9002"
]
}
},
"tls": {
"title": "TLS Configuration",
"description": "Configuration options for TLS for Kafka.",
"type": "object",
"properties": {
"key": {
"$ref": "https://raw.githubusercontent.com/roadrunner-server/roadrunner/refs/heads/master/schemas/config/3.0.schema.json#/definitions/TLSKeyFile"
},
"cert": {
"$ref": "https://raw.githubusercontent.com/roadrunner-server/roadrunner/refs/heads/master/schemas/config/3.0.schema.json#/definitions/TLSCertFile"
},
"root_ca": {
"$ref": "https://raw.githubusercontent.com/roadrunner-server/roadrunner/refs/heads/master/schemas/config/3.0.schema.json#/definitions/TLSCAFile"
},
"client_auth_type": {
"$ref": "https://raw.githubusercontent.com/roadrunner-server/roadrunner/refs/heads/master/schemas/config/3.0.schema.json#/definitions/TLSClientAuthType"
}
},
"required": [
"key",
"cert"
]
},
"sasl": {
"title": "SASL Authentication",
"type": "object",
"description": "Configuration for SASL authentication for Kafka.",
"properties": {
"mechanism": {
"description": "Mechanism used for the authentication.",
"type": "string",
"enum": [
"aws_msk_iam",
"plain",
"SCRAM-SHA-256",
"SCRAM-SHA-512"
]
},
"username": {
"description": "Username for authentication.",
"type": "string"
},
"password": {
"description": "Password for authentication.",
"type": "string"
},
"nonce": {
"description": "Optional for the SHA auth types. Empty by default.",
"type": "string"
},
"is_token": {
"description": "If true, suffixes the tokenauth=true extra attribute to the initial authentication message. Set this to true if the user and pass are from a delegation token. Optional for the SHA auth types. Defaults to false.",
"type": "boolean",
"default": false
},
"zid": {
"description": "Zid is an optional authorization ID to use in authenticating",
"type": "string"
},
"access_key": {
"description": "AWS Access key ID",
"type": "string"
},
"secret_key": {
"description": "AWS Secret Access key ID",
"type": "string"
},
"session_token": {
"description": "SessionToken, if non-empty, is a session / security token to use for authentication. See the following link for more details: https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html",
"type": "string"
},
"user_agent": {
"description": "UserAgent is the user agent to for the client to use when connecting to Kafka, overriding the default franz-go/<runtime.Version()>/<hostname>. Setting a UserAgent allows authorizing based on the aws:UserAgent condition key; see the following link for more details: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-useragent",
"type": "string"
}
}
}
}
}
}
}

0 comments on commit 92f3460

Please sign in to comment.