KubeMQ
IntegrationsRay ServeReference

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.py
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 because on_dlq is a Callable, which Pydantic would otherwise reject as a field type.
  • auth_token is declared with repr=False, so it never appears in repr(config) or log output, and on_dlq is declared with exclude=True, so it is dropped from model_dump() / model_dump_json(). Dumping the config to JSON therefore yields a clean, secret-free, callable-free record.
config.py
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.

Modetlstls_ca_filetls_cert_filetls_key_file
Plaintext (default)False
TLS (server auth)Truerequired
Mutual TLSTruerequiredrequiredrequired

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").

DependencyConstraintPurpose
kubemq>=4.1.5KubeMQ Python SDK (Queues, Queries, Events clients).
ray[serve]>=2.50.0Ray Serve runtime and the TaskProcessorAdapter framework.
pydantic>=2.0Config model validation.
install
uv pip install kubemq-rayserve

Broker 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:next

Port 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?

On this page