{"id":43762162,"url":"https://github.com/kcenon/messaging_system","last_synced_at":"2026-02-05T15:08:06.880Z","repository":{"id":39166155,"uuid":"341050869","full_name":"kcenon/messaging_system","owner":"kcenon","description":"📬 Modern C++20 messaging infrastructure with pub/sub, request/reply, event streaming, and message pipeline patterns","archived":false,"fork":false,"pushed_at":"2025-12-30T05:07:26.000Z","size":270530,"stargazers_count":30,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T01:13:04.035Z","etag":null,"topics":["asynchronous","cpp17","logging","message-passing","microservices","priority-queue","rest-api","tcp","tcp-client","tcp-server","threadpool"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kcenon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-02-22T01:55:38.000Z","updated_at":"2025-12-30T05:05:42.000Z","dependencies_parsed_at":"2024-06-13T17:20:30.653Z","dependency_job_id":"0e69d923-0878-4df0-87fb-67234046c780","html_url":"https://github.com/kcenon/messaging_system","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kcenon/messaging_system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcenon%2Fmessaging_system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcenon%2Fmessaging_system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcenon%2Fmessaging_system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcenon%2Fmessaging_system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kcenon","download_url":"https://codeload.github.com/kcenon/messaging_system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcenon%2Fmessaging_system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29124793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T14:05:12.718Z","status":"ssl_error","status_checked_at":"2026-02-05T14:03:53.078Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asynchronous","cpp17","logging","message-passing","microservices","priority-queue","rest-api","tcp","tcp-client","tcp-server","threadpool"],"created_at":"2026-02-05T15:08:06.756Z","updated_at":"2026-02-05T15:08:06.867Z","avatar_url":"https://github.com/kcenon.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Messaging System\n\n\u003e **Language:** **English** | [한국어](README_KO.md)\n\n\u003cdiv align=\"center\"\u003e\n\n[![C++20](https://img.shields.io/badge/C%2B%2B-20-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B20)\n[![CI](https://github.com/kcenon/messaging_system/actions/workflows/ci.yml/badge.svg)](https://github.com/kcenon/messaging_system/actions/workflows/ci.yml)\n[![Coverage](https://github.com/kcenon/messaging_system/actions/workflows/coverage.yml/badge.svg)](https://github.com/kcenon/messaging_system/actions/workflows/coverage.yml)\n[![Static Analysis](https://github.com/kcenon/messaging_system/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/kcenon/messaging_system/actions/workflows/static-analysis.yml)\n\n**Modern Messaging Infrastructure with Advanced Patterns**\n\nComplete pub/sub, request/reply, event streaming, and message pipeline support\n\n[📚 Documentation](#-documentation) | [🔗 Quick Start](#-quick-start) | [📖 Examples](#-usage-examples) | [📊 Architecture](#-architecture) | [🔄 Contributing](#-contributing)\n\n\u003c/div\u003e\n\n---\n\n## ✨ Overview\n\nA **modern messaging system** built on C++20 with comprehensive support for enterprise messaging patterns. The system provides a complete messaging infrastructure with pluggable backends, advanced routing capabilities, and robust reliability features.\n\n### 🎯 Key Features\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n**Core Messaging**\n- **Message Bus** - Central pub/sub coordinator\n- **Topic Router** - Wildcard pattern matching (*, #)\n- **Message Queue** - Thread-safe priority queues\n- **Message Serialization** - Container-based payloads\n- **Trace Context** - Distributed tracing support\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n**Advanced Patterns**\n- **Pub/Sub** - Publisher and subscriber helpers\n- **Request/Reply** - Synchronous RPC over async messaging\n- **Event Streaming** - Event sourcing with replay\n- **Message Pipeline** - Pipes-and-filters processing\n- **DI Container** - Dependency injection support\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n**Backend Support**\n- **Standalone** - Self-contained execution\n- **Integration** - Thread pool integration\n- **Auto-detection** - Runtime backend selection\n- **Pluggable Executors** - IExecutor abstraction\n- **Mock Support** - Testing and development\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n**Production Quality**\n- **Thread-safe** - Lock-based and atomic operations\n- **Type-safe** - Result\u003cT\u003e error handling\n- **Well-tested** - 100+ unit/integration tests\n- **Benchmarked** - Performance validated\n- **Documented** - Comprehensive API docs\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## 📦 What's Included\n\nThe messaging system is fully implemented:\n\n### ✅ Core Components (Complete)\n\n- **Message Types** - Structured messages with metadata, priority, TTL\n- **Message Builder** - Fluent API for message construction\n- **Message Queue** - Thread-safe FIFO and priority queues\n- **Topic Router** - Pattern-based routing with wildcards\n- **Message Bus** - Async/sync pub/sub coordination\n- **Message Broker** - Advanced routing and filtering\n\n### ✅ Patterns (Complete)\n\n- **Pub/Sub Pattern** - Publisher and Subscriber classes\n- **Request/Reply Pattern** - Request client and server\n- **Event Streaming** - Event sourcing with replay capability\n- **Message Pipeline** - Stage-based message processing\n\n### ✅ Infrastructure (Complete)\n\n- **Backend Interface** - Pluggable execution backends\n- **Standalone Backend** - Self-contained thread pool\n- **Integration Backend** - External thread pool integration\n- **DI Container** - Service registration and resolution\n- **Error Codes** - Centralized error handling (-700 to -799)\n\n### ✅ Testing \u0026 Benchmarks (Complete)\n\n- **Unit Tests** - 100+ tests across all components\n- **Integration Tests** - End-to-end messaging scenarios\n- **Pattern Tests** - Comprehensive pattern validation\n- **Performance Benchmarks** - Throughput and latency testing\n\n### ✅ Documentation (Complete)\n\n- **API Reference** - Complete API documentation\n- **Migration Guide** - Upgrade instructions\n- **Patterns API** - Pattern usage guide\n- **Design Patterns** - Architecture documentation\n\n---\n\n## 🏗️ Architecture\n\n### System Overview\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    Messaging Patterns                        │\n│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐   │\n│  │ Pub/Sub  │  │ Req/Rep  │  │ Pipeline │  │ Stream   │   │\n│  └──────────┘  └──────────┘  └──────────┘  └──────────┘   │\n└─────────────────────────────────────────────────────────────┘\n                              │\n                              ▼\n┌─────────────────────────────────────────────────────────────┐\n│                      Message Bus                             │\n│  ┌──────────────────┐  ┌──────────────────┐                │\n│  │ Message Broker   │  │ Topic Router     │                │\n│  └──────────────────┘  └──────────────────┘                │\n└─────────────────────────────────────────────────────────────┘\n                              │\n                ┌─────────────┴─────────────┐\n                ▼                           ▼\n┌───────────────────────────┐   ┌───────────────────────────┐\n│   Message Queue           │   │  Subscription Manager     │\n│  ┌─────────────────────┐  │   │  ┌─────────────────────┐ │\n│  │ Priority Queue      │  │   │  │ Subscriber Registry │ │\n│  │ Dead Letter Queue   │  │   │  │ Filter Chain        │ │\n│  └─────────────────────┘  │   │  └─────────────────────┘ │\n└───────────────────────────┘   └───────────────────────────┘\n                              │\n                ┌─────────────┴─────────────┐\n                ▼                           ▼\n┌───────────────────────────┐   ┌───────────────────────────┐\n│  Integration Layer        │   │   Backend Selection       │\n│  ┌──────────────────┐     │   │  ┌──────────────────┐    │\n│  │ Logger Adapter   │     │   │  │ Standalone       │    │\n│  │ Monitor Adapter  │     │   │  │ Integration      │    │\n│  │ Thread Adapter   │     │   │  │ Auto-detect      │    │\n│  └──────────────────┘     │   │  └──────────────────┘    │\n└───────────────────────────┘   └───────────────────────────┘\n                              │\n                              ▼\n┌─────────────────────────────────────────────────────────────┐\n│              Foundation (common_system)                      │\n│   Result\u003cT\u003e, error_info, event_bus, interfaces              │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### Message Flow\n\n```\nPublisher → Message Bus → Topic Router → Subscribers\n    ↓           ↓              ↓             ↓\n  Message   Priority      Pattern      Callbacks\n  Builder    Queue        Matching     (async)\n```\n\n---\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- **C++20** compiler (GCC 11+, Clang 14+, MSVC 2022+, Apple Clang 14+)\n- **CMake** 3.20+\n- **vcpkg** (for dependency management)\n\n### Installation\n\n```bash\ngit clone https://github.com/kcenon/messaging_system.git\ncd messaging_system\n\n# Recommended: Use local sibling directories (for unified_system development)\n# Requires all system projects in the same parent directory:\n#   Sources/common_system/\n#   Sources/thread_system/\n#   Sources/messaging_system/\n#   ...\ncmake -B build -DMESSAGING_USE_LOCAL_SYSTEMS=ON\ncmake --build build -j\n\n# Alternative: Build with vcpkg\ncmake -B build -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake\ncmake --build build -j\n```\n\n### C++20 Module Build (Experimental)\n\nFor C++20 module support (requires CMake 3.28+ and compatible compiler):\n\n```bash\n# Build with C++20 modules enabled\ncmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \\\n    -DMESSAGING_BUILD_MODULES=ON \\\n    -DMESSAGING_USE_LOCAL_SYSTEMS=ON\ncmake --build build -j\n\n# Use the module in your project:\n# import kcenon.messaging;\n```\n\n**Requirements:**\n- CMake 3.28+\n- Ninja or Ninja Multi-Config generator\n- Clang 16+ or GCC 14+ or MSVC 17.4+\n\n**Module Structure:**\n- `kcenon.messaging` - Primary module interface\n- `kcenon.messaging:core` - Core messaging (message, queue, bus, broker)\n- `kcenon.messaging:patterns` - Messaging patterns (pub/sub, request/reply)\n- `kcenon.messaging:task` - Distributed task queue system\n- `kcenon.messaging:integration` - Transports, backends, DI\n\n### Dependency Management\n\nThe build system uses `UnifiedDependencies.cmake` module which supports three modes:\n\n| Mode | CMake Option | Description |\n|------|--------------|-------------|\n| **LOCAL** | `-DMESSAGING_USE_LOCAL_SYSTEMS=ON` | Use sibling directories (recommended for development) |\n| **FetchContent** | `-DMESSAGING_USE_FETCHCONTENT=ON` | Fetch from GitHub automatically |\n| **find_package** | (default) | Use installed system packages |\n\nThe unified module provides:\n- Automatic target mapping for different naming conventions\n- Consistent dependency resolution across all modes\n- Simplified CMakeLists.txt (~300 lines vs ~920 lines previously)\n\n### Basic Example\n\n```cpp\n#include \u003ckcenon/messaging/core/message_bus.h\u003e\n#include \u003ckcenon/messaging/core/message.h\u003e\n#include \u003ckcenon/messaging/backends/standalone_backend.h\u003e\n\nusing namespace kcenon::messaging;\n\nint main() {\n    // Create standalone backend\n    auto backend = std::make_shared\u003cstandalone_backend\u003e(4);\n    backend-\u003einitialize();\n\n    // Create message bus\n    message_bus_config config;\n    config.worker_threads = 4;\n    auto bus = std::make_shared\u003cmessage_bus\u003e(backend, config);\n    bus-\u003estart();\n\n    // Subscribe to topic\n    bus-\u003esubscribe(\"user.created\", [](const message\u0026 msg) {\n        std::cout \u003c\u003c \"User created: \" \u003c\u003c msg.metadata().id \u003c\u003c std::endl;\n        return common::VoidResult::ok();\n    });\n\n    // Publish message\n    auto msg = message_builder()\n        .topic(\"user.created\")\n        .source(\"app\")\n        .type(message_type::event)\n        .build();\n\n    if (msg.is_ok()) {\n        bus-\u003epublish(msg.value());\n    }\n\n    // Cleanup\n    std::this_thread::sleep_for(std::chrono::milliseconds(100));\n    bus-\u003estop();\n    backend-\u003eshutdown();\n\n    return 0;\n}\n```\n\n---\n\n## 📖 Usage Examples\n\n### Pub/Sub Pattern\n\n```cpp\n#include \u003ckcenon/messaging/patterns/pub_sub.h\u003e\n\nusing namespace kcenon::messaging::patterns;\n\n// Create publisher\nauto publisher = std::make_shared\u003cpatterns::publisher\u003e(bus, \"events\");\n\n// Publish events\nauto msg = message_builder()\n    .topic(\"events.user.login\")\n    .type(message_type::event)\n    .build();\npublisher-\u003epublish(msg.value());\n\n// Create subscriber\nauto subscriber = std::make_shared\u003cpatterns::subscriber\u003e(bus);\nsubscriber-\u003esubscribe(\"events.user.*\", [](const message\u0026 msg) {\n    // Handle user events\n    return common::VoidResult::ok();\n});\n```\n\n### Request/Reply Pattern\n\n```cpp\n#include \u003ckcenon/messaging/patterns/request_reply.h\u003e\n\nusing namespace kcenon::messaging::patterns;\n\n// Server side\nauto server = std::make_shared\u003crequest_server\u003e(bus, \"calculator\");\nserver-\u003eregister_handler([](const message\u0026 request) -\u003e common::Result\u003cmessage\u003e {\n    auto a = request.payload().get_value(\"a\").value\u003cint\u003e();\n    auto b = request.payload().get_value(\"b\").value\u003cint\u003e();\n\n    auto response = message_builder()\n        .topic(\"calculator.response\")\n        .type(message_type::reply)\n        .build();\n    response.value().payload().set_value(\"result\", a + b);\n\n    return response;\n});\n\n// Client side\nauto client = std::make_shared\u003crequest_client\u003e(bus);\nauto request = message_builder()\n    .topic(\"calculator.add\")\n    .type(message_type::query)\n    .build();\nrequest.value().payload().set_value(\"a\", 10);\nrequest.value().payload().set_value(\"b\", 20);\n\nauto response = client-\u003erequest(request.value(), std::chrono::seconds(5));\nif (response.is_ok()) {\n    auto result = response.value().payload().get_value(\"result\").value\u003cint\u003e();\n    std::cout \u003c\u003c \"Result: \" \u003c\u003c result \u003c\u003c std::endl;  // 30\n}\n```\n\n### Event Streaming\n\n```cpp\n#include \u003ckcenon/messaging/patterns/event_streaming.h\u003e\n\nusing namespace kcenon::messaging::patterns;\n\n// Create event stream\nauto stream = std::make_shared\u003cevent_stream\u003e(bus, \"orders\");\n\n// Publish events\nstream-\u003epublish_event(\"order.created\", order_data);\nstream-\u003epublish_event(\"order.paid\", payment_data);\nstream-\u003epublish_event(\"order.shipped\", shipping_data);\n\n// Replay events\nstream-\u003ereplay_from(std::chrono::system_clock::now() - std::chrono::hours(24),\n    [](const message\u0026 event) {\n        // Process historical events\n        return common::VoidResult::ok();\n    });\n```\n\n### Message Pipeline\n\n```cpp\n#include \u003ckcenon/messaging/patterns/message_pipeline.h\u003e\n\nusing namespace kcenon::messaging::patterns;\n\n// Build processing pipeline\nauto pipeline = pipeline_builder()\n    .add_stage(\"validate\", [](message\u0026 msg) {\n        // Validation logic\n        return common::VoidResult::ok();\n    })\n    .add_stage(\"transform\", [](message\u0026 msg) {\n        // Transformation logic\n        return common::VoidResult::ok();\n    })\n    .add_stage(\"enrich\", [](message\u0026 msg) {\n        // Enrichment logic\n        return common::VoidResult::ok();\n    })\n    .build();\n\n// Process message through pipeline\nauto msg = message_builder().topic(\"data\").build();\nauto result = pipeline.process(msg.value());\n```\n\n---\n\n## 🌟 Integration with Base Systems\n\nThe messaging system integrates seamlessly with specialized base systems:\n\n### Required Systems\n\n- **common_system** - Result\u003cT\u003e pattern, error handling, base interfaces\n- **thread_system** - High-performance thread pools for message dispatch\n- **container_system** - Type-safe message payloads and serialization\n\n### Optional Systems\n\n- **network_system** - Distributed messaging over TCP/IP\n- **monitoring_system** - Real-time metrics and performance telemetry\n- **database_system** - Message persistence and audit logging\n\n### Logging Configuration\n\nLogging is provided through common_system's `ILogger` interface with runtime binding\nvia `GlobalLoggerRegistry`. This allows flexible logger implementation injection:\n\n```cpp\n#include \u003ckcenon/common/logging/log_functions.h\u003e\n#include \u003ckcenon/common/interfaces/global_logger_registry.h\u003e\n\n// Register a logger with the global registry (typically at application startup)\nauto\u0026 registry = kcenon::common::interfaces::GlobalLoggerRegistry::instance();\nregistry.set_default_logger(my_logger_implementation);\n\n// Logging is now available throughout the messaging system\n// No explicit logger parameter needed in messaging components\n```\n\n### Integration Example\n\n```cpp\n#include \u003ckcenon/messaging/backends/integration_backend.h\u003e\n#include \u003ckcenon/thread/core/thread_pool.h\u003e\n#include \u003ckcenon/common/interfaces/global_logger_registry.h\u003e\n\n// Create thread pool from thread_system\nauto thread_pool = std::make_shared\u003cthread::thread_pool\u003e(8);\n\n// Get logger from common_system's GlobalLoggerRegistry\nauto logger = kcenon::common::interfaces::get_logger();\n\n// Create integration backend\nauto backend = std::make_shared\u003cintegration_backend\u003e(\n    thread_pool,\n    logger,\n    nullptr  // optional monitoring\n);\n\n// Create message bus\nauto bus = std::make_shared\u003cmessage_bus\u003e(backend);\nbus-\u003estart();\n\n// Messages are now dispatched via thread_system\n// And logged via common_system's ILogger interface\n```\n\n---\n\n## 📊 Performance\n\n### Benchmarks\n\nPerformance characteristics based on benchmark results:\n\n**Message Throughput**\n- Message creation: ~5M messages/sec\n- Queue operations: ~2M operations/sec\n- Topic routing: ~500K routes/sec\n- Pub/Sub: ~100K messages/sec\n- Request/Reply: ~50K requests/sec\n\n**Latency (p99)**\n- Message creation: \u003c 1 μs\n- Queue enqueue/dequeue: \u003c 2 μs\n- Topic matching: \u003c 5 μs\n- End-to-end pub/sub: \u003c 100 μs\n- Request/reply: \u003c 1 ms\n\n### Running Benchmarks\n\n```bash\n# Build with benchmarks\ncmake -B build -DMESSAGING_BUILD_BENCHMARKS=ON\ncmake --build build -j\n\n# Run benchmarks\n./build/test/benchmarks/bench_message_creation\n./build/test/benchmarks/bench_message_queue\n./build/test/benchmarks/bench_topic_router\n./build/test/benchmarks/bench_pub_sub_throughput\n./build/test/benchmarks/bench_request_reply_latency\n```\n\n---\n\n## 🧪 Testing\n\nThe system includes comprehensive test coverage:\n\n### Test Suites\n\n- **Core Tests** - Message, queue, router, bus (40+ tests)\n- **Backend Tests** - Standalone and integration backends (27 tests)\n- **Pattern Tests** - All messaging patterns (80+ tests)\n- **Integration Tests** - End-to-end scenarios (4 test suites)\n\n### Running Tests\n\n```bash\n# Build with tests\ncmake -B build -DMESSAGING_BUILD_TESTS=ON\ncmake --build build -j\n\n# Run all tests\ncd build\nctest --output-on-failure\n\n# Run specific test suite\n./test/unit/core/test_message_bus\n./test/unit/patterns/test_pub_sub\n./test/integration_tests/test_full_integration\n```\n\n### Coverage Report\n\n```bash\n# Generate coverage report\ncmake -B build -DCMAKE_BUILD_TYPE=Coverage\ncmake --build build -j\ncd build\nctest\nlcov --capture --directory . --output-file coverage.info\ngenhtml coverage.info --output-directory coverage_html\n```\n\n---\n\n## 📚 Documentation\n\n### Core Documentation\n\n- **[Benchmarks](docs/BENCHMARKS.md)** - Performance characteristics and measurements\n- **[Features](docs/FEATURES.md)** - Complete feature documentation\n- **[Production Quality](docs/PRODUCTION_QUALITY.md)** - Quality assurance and reliability\n- **[Project Structure](docs/PROJECT_STRUCTURE.md)** - Codebase organization\n- [API Reference](docs/API_REFERENCE.md) - Complete API documentation\n- [Migration Guide](docs/MIGRATION_GUIDE.md) - Upgrade instructions\n- [Patterns API](docs/PATTERNS_API.md) - Messaging patterns guide\n- [Design Patterns](docs/DESIGN_PATTERNS.md) - Architecture patterns\n\n### Additional Resources\n\n- [Examples](examples/) - Working code examples\n- [Integration Tests](integration_tests/) - End-to-end test scenarios\n- [Performance Benchmarks](test/benchmarks/) - Performance benchmark suite\n\n---\n\n## 🔧 Build Options\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `MESSAGING_USE_LOCAL_SYSTEMS` | OFF | Use sibling directories for dependencies |\n| `MESSAGING_USE_FETCHCONTENT` | OFF | Auto-fetch dependencies from GitHub |\n| `MESSAGING_BUILD_TESTS` | ON | Build unit and integration tests |\n| `MESSAGING_BUILD_EXAMPLES` | ON | Build example programs |\n| `MESSAGING_BUILD_BENCHMARKS` | OFF | Build performance benchmarks |\n| `KCENON_WITH_NETWORK_SYSTEM` | ON | Enable network_system integration for transport implementations |\n| `KCENON_WITH_MONITORING_SYSTEM` | OFF | Enable monitoring_system integration for metrics collection |\n\n### Optional Dependency Matrix\n\nThe messaging_system has optional dependencies that can be enabled or disabled at compile time:\n\n| Dependency | Guard Macro | Components Affected | Fallback Behavior |\n|------------|-------------|---------------------|-------------------|\n| network_system | `KCENON_WITH_NETWORK_SYSTEM` | `http_transport`, `websocket_transport` | Returns `error::not_supported` |\n| monitoring_system | `KCENON_WITH_MONITORING_SYSTEM` | `message_bus_collector` | No-op (silently ignores operations) |\n\nEach optional component provides a compile-time `is_available` constant:\n\n```cpp\n#include \u003ckcenon/messaging/adapters/http_transport.h\u003e\n#include \u003ckcenon/messaging/adapters/websocket_transport.h\u003e\n#include \u003ckcenon/messaging/collectors/message_bus_collector.h\u003e\n\n// Check at compile time\nstatic_assert(http_transport::is_available || !http_transport::is_available,\n              \"Compile-time check example\");\n\n// Or check at runtime via feature flags\n#include \u003ckcenon/messaging/config/feature_flags.h\u003e\n\nif (kcenon::messaging::config::has_network_system()) {\n    // Use full transport functionality\n} else {\n    // Handle fallback case\n}\n```\n\n### Network System Integration\n\nThe `KCENON_WITH_NETWORK_SYSTEM` option controls whether `websocket_transport` and `http_transport` use the actual network_system implementation:\n\n```bash\n# Full transport functionality (default)\ncmake -B build -DKCENON_WITH_NETWORK_SYSTEM=ON\n\n# Stub mode - transports return not_supported errors\ncmake -B build -DKCENON_WITH_NETWORK_SYSTEM=OFF\n```\n\nWhen disabled, transport classes compile but return `error::not_supported` for all operations. This allows building the messaging system without the network_system dependency.\n\n### Isolated Build (No Optional Dependencies)\n\nTo verify that fallback implementations work correctly, use the isolated build preset:\n\n```bash\n# Configure and build in isolated mode\ncmake --preset=isolated\ncmake --build --preset=isolated\n\n# Run tests in isolated mode\nctest --preset=isolated\n\n# Or use the verification script\n./scripts/verify_isolated_build.sh\n```\n\nThe isolated preset disables all optional dependencies (`KCENON_WITH_NETWORK_SYSTEM=OFF`, `KCENON_WITH_MONITORING_SYSTEM=OFF`) and runs tests to verify fallback implementations.\n\n### Example Builds\n\n```bash\n# Development build with local systems\ncmake -B build -DMESSAGING_USE_LOCAL_SYSTEMS=ON -DMESSAGING_BUILD_TESTS=ON\ncmake --build build -j\n\n# Production build with FetchContent\ncmake -B build -DMESSAGING_USE_FETCHCONTENT=ON -DCMAKE_BUILD_TYPE=Release\ncmake --build build -j\nsudo cmake --install build\n\n# Debug build with all features\ncmake -B build -DCMAKE_BUILD_TYPE=Debug \\\n    -DMESSAGING_BUILD_TESTS=ON \\\n    -DMESSAGING_BUILD_EXAMPLES=ON \\\n    -DMESSAGING_BUILD_BENCHMARKS=ON\ncmake --build build -j\n```\n\n---\n\n## 🌐 Platform Support\n\n| Platform | Compiler | Status |\n|----------|----------|--------|\n| Ubuntu 22.04 | GCC 11+ | ✅ Tested |\n| Ubuntu 22.04 | Clang 14+ | ✅ Tested |\n| macOS 13+ | Apple Clang 14+ | ✅ Tested |\n| Windows 10+ | MSVC 2022+ | ✅ Tested |\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome!\n\n### How to Contribute\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes with tests\n4. Ensure all tests pass\n5. Submit a pull request\n\n### Development Workflow\n\n```bash\n# Clone repository\ngit clone https://github.com/kcenon/messaging_system.git\ncd messaging_system\n\n# Create feature branch\ngit checkout -b feature/amazing-feature\n\n# Build and test\ncmake -B build -DMESSAGING_BUILD_TESTS=ON\ncmake --build build -j\ncd build \u0026\u0026 ctest\n\n# Commit and push\ngit commit -m \"feat: add amazing feature\"\ngit push origin feature/amazing-feature\n```\n\n---\n\n## 📄 License\n\n**BSD 3-Clause License**\n\nCopyright (c) 2021-2025, Messaging System Contributors\nAll rights reserved.\n\nSee [LICENSE](LICENSE) file for full license text.\n\n---\n\n## 📬 Contact \u0026 Support\n\n- **Author**: kcenon ([@kcenon](https://github.com/kcenon))\n- **Email**: kcenon@gmail.com\n- **Issues**: [GitHub Issues](https://github.com/kcenon/messaging_system/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/kcenon/messaging_system/discussions)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Built on specialized systems**\n\n[common_system](https://github.com/kcenon/common_system) •\n[thread_system](https://github.com/kcenon/thread_system) •\n[monitoring_system](https://github.com/kcenon/monitoring_system) •\n[container_system](https://github.com/kcenon/container_system) •\n[database_system](https://github.com/kcenon/database_system) •\n[network_system](https://github.com/kcenon/network_system)\n\nMade with ❤️ by the Open Source Community\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcenon%2Fmessaging_system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkcenon%2Fmessaging_system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcenon%2Fmessaging_system/lists"}