Python SDK
Python SDK availability, current support status, and planned integration surface.
Planned — no official Python SDK is published yet. The repository currently ships the JavaScript / TypeScript package messagex-client only. There is no supported PyPI package or installation command.
Do not install a similarly named third-party package and assume it is maintained or compatible with this broker.
Current status
A Python application can reach a MessageX TCP listener only if it implements the documented protocol itself. Such a custom client is not an officially supported MessageX SDK and must be tested against the broker's protocol version.
The official TCP protocol reference documents the frame format:
- Four-byte unsigned big-endian payload length.
- UTF-8 JSON payload.
- Protocol version 1 command, response, and event envelopes.
- A maximum frame payload of 1 MiB.
Planned Python package scope
When an official package is released, its guide will include:
- Supported Python versions and PyPI installation.
- Async and/or synchronous client API design.
- TCP connection timeout and socket lifecycle.
- CONNECT and AUTH handshake.
- Queue and exchange declaration/deletion.
- Direct, fanout, topic, and headers bindings.
- Publishing JSON-serializable messages and headers.
- Consumer callbacks/async iterators and delivery tags.
- Explicit ACK, NACK, retry, and cancellation.
- Typed exceptions, reconnect policy, and test coverage.
Planned API shape (illustrative only)
The following is a conceptual example, not a working package API:
# Illustrative pseudocode — no official package exists yet.
client = MessageXClient(
host="127.0.0.1",
port=5678,
username="app-user",
password=os.environ["MESSAGEX_PASSWORD"],
)
await client.connect()
await client.queue.declare(name="orders", durable=True)
async def handle(message):
try:
await process_order(message.body)
await message.ack()
except Exception:
await message.nack(requeue=True)
await client.consume(queue_name="orders", callback=handle)Do not copy this into an application expecting it to run today.
Compatibility and delivery requirements
A future Python SDK must match the broker's framing, protocol validation, request correlation, event delivery, and delivery ownership checks. It must also document the broker's current prefetch count of one per connection and queue, and the fact that the broker does not provide a distributed transaction with application databases.
Until the official package is released, use the supported JavaScript / TypeScript SDK or implement the wire protocol independently with the understanding that the custom client is your responsibility.