Skip to main content

Synchronous HTTP to Kafka proxy with request-reply pattern

Project description

Kafka HTTP Proxy

Синхронный прокси для передачи HTTP запросов через Apache Kafka с паттерном request-reply.

Установка

pip install git+https://github.com/fedorovvl/kafka-http-proxy.git

Быстрый старт

Прокси (сервер А)

# Переменные окружения
export KAFKA_BOOTSTRAP_SERVERS=kafka:9092
export WARMUP_TOPICS=common-responses,orders-responses
export PROXY_PORT=8080

kafka-proxy

Или с конфиг файлом:

kafka-proxy --config proxy_config.yaml

Обработчик (сервер Б)

export KAFKA_BOOTSTRAP_SERVERS=kafka:9092
export KAFKA_TOPICS=orders:orders-requests,orders-responses,http://backend:8080
kafka-processor

Архитектура

Клиент → Nginx → Прокси → Kafka → Обработчик → Бекенд
                        ↑________________________↓
                        (синхронный ответ через Kafka)

Docker

cd examples
docker-compose up -d

Метрики

Prometheus метрики доступны на /metrics:

proxy_requests_total - количество запросов
proxy_request_latency_seconds - латентность запросов
proxy_pending_requests - ожидающие запросы
processor_messages_total - обработанные сообщения
processor_latency_seconds - латентность обработки

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kafka_http_proxy-1.0.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file kafka_http_proxy-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kafka_http_proxy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a1df195e26f58d70cf9136a3801ad703526576c89b6ea684455ccf22cd40af7
MD5 3f880080da7116233bc8b33a81c84dab
BLAKE2b-256 b2e293897ba4a8a773545723dd54401f901dc5313ae4d4447829dd01d1ff02c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page