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 0f86e3e
Showing 1 changed file with 185 additions and 0 deletions.
185 changes: 185 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"title": "roadrunner-kafka",
"type": "object",
"description": "The schema contains all the valid configuration parameters for the Kafka plugin for the roadrunner job system.",
"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
}
}
}
}
}
}
}
}
}
}
}
}
}

0 comments on commit 0f86e3e

Please sign in to comment.