Skip to main content

A ZeroMQ messaging router and client

Project description

Hydra Router

A standalone ZeroMQ-based message routing system that provides reliable communication between multiple clients and a single server.

Features

  • Centralized Message Routing: Routes messages between multiple clients and a single server
  • Message Format Conversion: Automatic conversion between internal and router message formats
  • Heartbeat Monitoring: Automatic client health monitoring and connection tracking
  • Comprehensive Error Handling: Detailed validation and error reporting
  • Simple Examples: Includes simple client/server examples for quick testing
  • Client Registry Query: Query router for connected client information

Installation

pip install hydra-router

Quick Start

Start the Router

# Basic usage
hydra-router

# Custom configuration
hydra-router --address 0.0.0.0 --port 5556 --log-level INFO

Simple Client/Server Demo

# Terminal 1: Start the router
hydra-router --log-level DEBUG

# Terminal 2: Start the simple server
hydra-server_simple --router tcp://localhost:5556

# Terminal 3: Start the simple client
hydra-client_simple --router tcp://localhost:5556
# Then enter numbers to see their squares calculated by the server

Using the MQClient Library

from hydra_router import MQClient, RouterConstants

# Create a client
client = MQClient(
    router_address="tcp://localhost:5556",
    client_type=RouterConstants.HYDRA_CLIENT,
    client_id="my-client-001"
)

# Connect and send messages
await client.connect()
await client.send_message(my_message)

# Query connected clients
client_table = await client.request_client_registry()
print("Connected clients:", client_table)

Architecture

The Hydra Router system consists of:

  • HydraRouter: Central message routing component
  • MQClient: Generic client library for applications
  • RouterConstants: Message format definitions and constants
  • SimpleClient/SimpleServer: Example applications

Configuration

The router supports the following command-line options:

  • --address, -a: IP address to bind to (default: 0.0.0.0)
  • --port, -p: Port to bind to (default: 5556)
  • --log-level: Logging level (DEBUG, INFO, WARNING, ERROR, default: INFO)
  • --help, -h: Show help message

Requirements

  • Python 3.11+
  • ZeroMQ (pyzmq)

License

GPL-3.0

Contributing

This project follows the specification-driven development methodology. See the .kiro/specs/ directory for detailed requirements, design, and implementation tasks.

Project details


Download files

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

Source Distribution

hydra_router-0.3.1.tar.gz (39.1 kB view details)

Uploaded Source

Built Distribution

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

hydra_router-0.3.1-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file hydra_router-0.3.1.tar.gz.

File metadata

  • Download URL: hydra_router-0.3.1.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for hydra_router-0.3.1.tar.gz
Algorithm Hash digest
SHA256 9d486217e689224bb826df5044ce9928bf58290001d4e83087dda2a90995be61
MD5 e22d3e3916f2db65cd31e9bd21d6825a
BLAKE2b-256 32047ed2921d696711bbea13c6520efbd2eb891a7f9497b940975f981dcd9b9d

See more details on using hashes here.

File details

Details for the file hydra_router-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: hydra_router-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for hydra_router-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32c324f7db8dd81e64593b3a90a4c97ebad6557cc9dc603868ae8d5c419e3169
MD5 64eb701a8ea236d7de7d78d45981db27
BLAKE2b-256 1becf6d050ff536333d937320dd7be2db378f44f0395748697e124130370644d

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