Historical Data Test Client
Simple ZMQ client to test historical OHLC data retrieval from Flink.
Usage
Run with Docker Compose
The client is included in the docker-compose.yml. To run it:
cd redesign
docker-compose up history-test-client
Run locally
pip install pyzmq
python client.py
What it does
- Connects to Flink's client request endpoint (REQ/REP on port 5559)
- Requests 1-hour OHLC candles for BINANCE:BTC/USDT
- Time range: January 1-7, 2026 (168 candles)
- Waits for Flink to respond (up to 30 seconds)
- Displays the response status and sample data
Protocol
Uses the ZMQ message format:
- Frame 1: Protocol version byte (0x01)
- Frame 2: Message type (0x07 = OHLCRequest) + protobuf payload
Expected response:
- Frame 1: Protocol version byte (0x01)
- Frame 2: Message type (0x08 = Response) + protobuf payload
Configuration
Edit client.py to change:
flink_host: Flink hostname (default: 'localhost')client_request_port: Port number (default: 5559)- Query parameters: ticker, time range, period, limit