From d717479b54359b45d5c6712a51bb49b20b009b23 Mon Sep 17 00:00:00 2001 From: Nicolai Cornelis Date: Wed, 23 Oct 2024 18:35:13 +0200 Subject: [PATCH] Add schema --- schema.json | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 schema.json diff --git a/schema.json b/schema.json new file mode 100644 index 0000000..9b747cc --- /dev/null +++ b/schema.json @@ -0,0 +1,83 @@ +{ + "$id": "https://raw.githubusercontent.com/roadrunner-server/nats/refs/heads/master/schema.json", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "title": "roadrunner-nats", + "description": "The schema contains all the valid configuration parameters for the NATS plugin for the roadrunner job system.", + "definitions": { + "pipeline": { + "type": "object", + "required": [ + "driver", + "config" + ], + "additionalProperties": false, + "properties": { + "driver": { + "type": "string", + "enum": [ + "nats" + ] + }, + "config": { + "type": "object", + "description": "Configuration for the NATS driver.", + "additionalProperties": false, + "properties": { + "priority": { + "$ref": "https://raw.githubusercontent.com/roadrunner-server/jobs/refs/heads/master/schema.json#/definitions/PipelineProperties/priority" + }, + "prefetch": { + "$ref": "https://raw.githubusercontent.com/roadrunner-server/jobs/refs/heads/master/schema.json#/definitions/PipelineProperties/prefetch" + }, + "consume_all": { + "$ref": "https://raw.githubusercontent.com/roadrunner-server/jobs/refs/heads/master/schema.json#/definitions/PipelineProperties/consume_all" + }, + "subject": { + "description": "NATS subject", + "type": "string", + "default": "default" + }, + "stream": { + "description": "NATS stream", + "type": "string", + "default": "default-stream" + }, + "deliver_new": { + "description": "Whether to only receive messages that were created after the consumer was created.", + "type": "boolean", + "default": false + }, + "rate_limit": { + "description": "Consumer rate-limiter in bytes. See https://docs.nats.io/jetstream/concepts/consumers#ratelimit", + "type": "integer", + "default": 1000, + "minimum": 0 + }, + "delete_stream_on_stop": { + "description": "Whether to delete the stream after the pipeline is stopped.", + "type": "boolean", + "default": false + }, + "delete_after_ack": { + "description": "Whether to delete messages from the stream after successful acknowledgement.", + "type": "boolean", + "default": false + } + } + } + } + }, + "driver": { + "type": "object", + "additionalProperties": false, + "description": "Configuration options for the NATS driver.", + "properties": { + "addr": { + "description": "NATS server address.", + "type": "string", + "default": "nats://127.0.0.1:4222" + } + } + } + } +}