Configuration Reference
Every KubeMQAdapterConfig field, validation rules, dependencies, and the broker requirement for kubemq-rayserve.
This page is the authoritative reference for configuring kubemq-rayserve: every
KubeMQAdapterConfig field, its default and validation rule, the package dependencies, and the
broker the adapter connects to. For the adapter methods, autoscaling policy, and metrics surface,
see the API reference. For task-oriented walkthroughs see the
configuration guide and connection & security guide.
KubeMQAdapterConfig
KubeMQAdapterConfig is a Pydantic BaseModel. It is passed via TaskProcessorConfig.adapter_config
when deploying a Ray Serve @task_consumer, or directly to KubeMQTaskProcessorAdapter(config) for
standalone use. Every field has a default, so KubeMQAdapterConfig() is valid and connects to
localhost:50000.
Prop
Type
config = KubeMQAdapterConfig(
address="kubemq:50000",
auth_token="your-jwt-token",
tls=True,
tls_ca_file="/etc/kubemq/ca.pem",
result_expiry_seconds=7200,
sync_inference_timeout=45,
on_dlq=lambda task_id, error: print(f"DLQ {task_id}: {error}"),
)result_expiry_seconds is validated with ge=0, le=86400 — values outside 0..86400 raise a
Pydantic ValidationError at construction. auth_token is marked repr=False and on_dlq is
excluded from serialization, so neither leaks into model_dump() or log output.
Validation and serialization
Two field-level choices make the model safe to serialize even though it carries a callback:
model_config = {"arbitrary_types_allowed": True}is required becauseon_dlqis aCallable, which Pydantic would otherwise reject as a field type.auth_tokenis declared withrepr=False, so it never appears inrepr(config)or log output, andon_dlqis declared withexclude=True, so it is dropped frommodel_dump()/model_dump_json(). Dumping the config to JSON therefore yields a clean, secret-free, callable-free record.
result_expiry_seconds: int = Field(default=3600, ge=0, le=86400)
auth_token: str = Field(default="", repr=False)
on_dlq: Callable[[str, str], None] | None = Field(default=None, exclude=True)
model_config = {"arbitrary_types_allowed": True}TLS modes
The four TLS fields map directly onto the SDK's TLSConfig. Each is normalized to None when
empty, so one config shape covers plaintext, server-auth TLS, and mutual TLS.
| Mode | tls | tls_ca_file | tls_cert_file | tls_key_file |
|---|---|---|---|---|
| Plaintext (default) | False | — | — | — |
| TLS (server auth) | True | required | — | — |
| Mutual TLS | True | required | required | required |
The connection & security guide walks through each mode with runnable examples.
Dependencies and supported Python
kubemq-rayserve targets CPython 3.10 through 3.13 (requires-python = ">=3.10").
| Dependency | Constraint | Purpose |
|---|---|---|
kubemq | >=4.1.5 | KubeMQ Python SDK (Queues, Queries, Events clients). |
ray[serve] | >=2.50.0 | Ray Serve runtime and the TaskProcessorAdapter framework. |
pydantic | >=2.0 | Config model validation. |
uv pip install kubemq-rayserveBroker requirement
kubemq-rayserve is a client-side Python package built on native gRPC SDK clients — it needs no
connector enable flag on the broker. It talks to the standard gRPC port 50000, which is always
available on a running KubeMQ server. For local development, start one with Docker:
docker run -d \ --name kubemq \ -p 50000:50000 \ -p 9090:9090 \ -e KUBEMQ_TOKEN=YOUR_LICENSE_KEY \ europe-docker.pkg.dev/kubemq/images/kubemq:nextPort 50000 is the gRPC endpoint the adapter and the kubemq_queue_depth_policy autoscaler use.
Port 9090 is the shared HTTP server (REST and the AI-agent connectors), and the dashboard runs
on port 8080 — neither is required by the adapter itself.
Was this page helpful?