Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
238 changes: 238 additions & 0 deletions test/v2.13/messaging/kafka.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
{
"description": "Full JSON Schema test",
"target": "https://www.krakend.io/schema/v2.13/krakend.json",
"tests": [
{
"description": "Workflow test case",
"data": {
"version": 3,
"debug_endpoint": true,
"host": [
"http://localhost:8080"
],
"async_agent": [
{
"name": "stocksconsumer",
"extra_config": {
"async/kafka": {
"group_id": "my_group_id",
"topics": [
"stockprice"
],
"connection": {
"brokers": [
"localhost:9092"
],
"client_id": "cid_stocksconsumer"
},
"consumer": {}
}
},
"connection": {
"max_retries": 2,
"backoff_strategy": "linear",
"health_interval": "30s"
},
"consumer": {
"topic": "*",
"workers": 1,
"timeout": "1s"
},
"backend": [
{
"url_pattern": "/__debug/stocksconsumer/received"
}
]
},
{
"name": "portfolioupdatesconsumer",
"extra_config": {
"async/kafka": {
"group_id": "k_async_updates",
"topics": [
"portfolioupdates"
],
"connection": {
"brokers": [
"localhost:49092"
],
"client_id": "cid_portfolioupdateconsumer",
"client_tls": {
"allow_insecure_connections": false,
"ca_certs": [
"./config/ca/cacert.pem"
],
"client_certs": [
{
"certificate": "./config/certs/client/client.signed.pem",
"private_key": "./config/certs/client/client.key"
}
]
}
},
"consumer": {}
}
},
"connection": {
"max_retries": 2,
"backoff_strategy": "linear",
"health_interval": "30s"
},
"consumer": {
"topic": "*",
"workers": 1,
"timeout": "1s"
},
"backend": [
{
"url_pattern": "/__debug/portfolioupdates/received"
}
]
}
],
"endpoints": [
{
"endpoint": "/portfolio/order",
"method": "POST",
"input_headers": [
"X-Idempotency-Key",
"Some-Meta"
],
"backend": [
{
"url_pattern": "/_publisher/",
"extra_config": {
"backend/pubsub/publisher/kafka": {
"success_status_code": 201,
"writer": {
"topic": "orderplacement",
"key_meta": "X-Idempotency-Key",
"connection": {
"brokers": [
"localhost:49092"
],
"client_id": "krakend_async_agent",
"client_tls": {
"allow_insecure_connections": false,
"ca_certs": [
"./config/ca/cacert.pem"
],
"client_certs": [
{
"certificate": "./config/certs/client/client.signed.pem",
"private_key": "./config/certs/client/client.key"
}
]
}
},
"producer": {
"idempotent": true
}
}
}
}
}
]
},
{
"endpoint": "/portfolio/order",
"method": "GET",
"backend": [
{
"url_pattern": "/_consumer/",
"extra_config": {
"backend/pubsub/subscriber/kafka": {
"reader": {
"topics": [
"orderplacement"
],
"key_meta": "X-Idempotency-Key",
"group_id": "k_endpoint_read",
"connection": {
"brokers": [
"localhost:49092"
],
"client_id": "krakend_async_agent",
"client_tls": {
"allow_insecure_connections": false,
"ca_certs": [
"./config/ca/cacert.pem"
],
"client_certs": [
{
"certificate": "./config/certs/client/client.signed.pem",
"private_key": "./config/certs/client/client.key"
}
]
}
},
"consumer": {
"isolation_level": "read_commited"
}
}
}
}
}
]
}
],
"extra_config": {
"telemetry/opentelemetry": {
"service_name": "krakend_prometheus_service",
"metric_reporting_period": 1,
"trace_sample_rate": 1,
"exporters": {
"otlp": [
{
"disable_metrics": true,
"disable_traces": false,
"host": "localhost",
"name": "tempo",
"port": 54317,
"use_http": false
}
],
"prometheus": [
{
"name": "local_prometheus",
"port": 9099,
"process_metrics": true,
"go_metrics": true
}
]
},
"layers": {
"global": {
"disable_metrics": false,
"disable_propagation": false,
"disable_traces": false,
"report_headers": true
},
"proxy": {
"disable_metrics": false,
"disable_traces": true,
"report_headers": true
},
"backend": {
"metrics": {
"detailed_connection": true,
"disable_stage": false,
"read_payload": false,
"round_trip": false
},
"traces": {
"detailed_connection": false,
"disable_stage": false,
"read_payload": false,
"report_headers": false,
"round_trip": false
}
}
}
}
}
},
"valid": true
}
]
}
14 changes: 13 additions & 1 deletion v2.13/async_agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,24 @@
},
"extra_config": {
"description": "Defines the driver that connects to your queue or PubSub system. In addition, you can place other middlewares to modify the request (message) or the response, apply logic or any other endpoint middleware, but adding the driver is mandatory.\n\nSee: https://www.krakend.io/docs/async/",
"required": [ "async/amqp" ],
"oneOf": [
{
"required": [ "async/amqp" ]
},
{
"required": [ "async/kafka" ]
}
],
"properties": {
"async/amqp": {
"title": "Async Agent extra configuration",
"description": "[See the configuration for async/amqp](https://www.krakend.io/docs/async/amqp/)",
"$ref": "async/amqp.json"
},
"async/kafka": {
"title": "Kafka driver",
"description": "config details to consume from kafka topics",
"$ref": "messaging/kafka/reader.json"
}
}
},
Expand Down
28 changes: 28 additions & 0 deletions v2.13/backend/pubsub/kafka/publisher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://www.krakend.io/schema/v2.13/backend/pubsub/kafka/publisher.json",
"title": "PubSub Kafka Publisher EE",
"description": "Enterprise only. Allows for fine grained control over a kafka publishing connection",
"type": "object",
"required": [ "writer" ],
"properties": {
"success_status_code": {
"title": "Success Status Code",
"description": "HTTP status code to return for a successful write in the queue",
"default": 200,
"type": "number",
"maximum": 201,
"minimum": 200
},
"writer": {
"title": "Writer",
"description": "Define how to write messages to a kafka topic",
"$ref": "../../../messaging/kafka/writer.json",
"type": "object"
}
},
"patternProperties": {
"^[@$_#]": true
},
"additionalProperties": false
}
20 changes: 20 additions & 0 deletions v2.13/backend/pubsub/kafka/subscriber.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://www.krakend.io/schema/v2.13/backend/pubsub/kafka/subscriber.json",
"title": "PubSub Kafka Subscriber EE",
"description": "Enterprise only. Allows for fine grained control over a kafka subcription connection",
"type": "object",
"required": [ "reader" ],
"properties": {
"reader": {
"title": "Reader",
"description": "Define how to read messages from a kafka topic",
"$ref": "../../../messaging/kafka/reader.json",
"type": "object"
}
},
"patternProperties": {
"^[@$_#]": true
},
"additionalProperties": false
}
6 changes: 6 additions & 0 deletions v2.13/backend_extra_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
"backend/pubsub/subscriber": {
"$ref": "backend/pubsub/subscriber.json"
},
"backend/pubsub/publisher/kafka": {
"$ref": "backend/pubsub/kafka/publisher.json"
},
"backend/pubsub/subscriber/kafka": {
"$ref": "backend/pubsub/kafka/subscriber.json"
},
"backend/soap": {
"$ref": "backend/soap.json"
},
Expand Down
Loading