gRPC transport for milvus-clj.client. Wraps io.milvus/milvus-sdk-java.
Responsibilities:
open fn).IMilvusCore + IMilvusAdmin + IMilvusExtras via a
GrpcClient defrecord that holds the service client and its own
config for lifecycle.client/classify-error.Keepalive defaults are tuned for fragile intermediaries (tailscale
userspace netstack, cloud NAT). keepAliveWithoutCalls(true) is the
critical bit: without it gRPC only pings during active RPCs, so idle
clients die silently with
UNAVAILABLE: Keepalive failed. The connection is likely gone.
This ns is loaded lazily via requiring-resolve from
milvus-clj.client/make, so the gRPC Java SDK classes are only
loaded when the gRPC transport is actually selected.
gRPC transport for `milvus-clj.client`. Wraps `io.milvus/milvus-sdk-java`.
Responsibilities:
- Build a MilvusServiceClient from config (the `open` fn).
- Implement `IMilvusCore` + `IMilvusAdmin` + `IMilvusExtras` via a
`GrpcClient` defrecord that holds the service client and its own
config for lifecycle.
- Translate ex-info-tagged errors for `client/classify-error`.
Keepalive defaults are tuned for fragile intermediaries (tailscale
userspace netstack, cloud NAT). `keepAliveWithoutCalls(true)` is the
critical bit: without it gRPC only pings during active RPCs, so idle
clients die silently with
`UNAVAILABLE: Keepalive failed. The connection is likely gone`.
This ns is loaded lazily via `requiring-resolve` from
`milvus-clj.client/make`, so the gRPC Java SDK classes are only
loaded when the gRPC transport is actually selected.HTTP/REST transport for milvus-clj.client. Talks Milvus v2.5.x REST API
on port 19530 (yes, the same port as gRPC — Milvus 2.5+ multiplexes via
the proxy) via java.net.http.HttpClient + clojure.data.json.
PORT GOTCHA: do NOT use 9091. That's the metrics/health endpoint and
returns 404 page not found on every REST API call. Milvus 2.5+ serves
gRPC and the v2 REST API on the SAME port (19530) via the proxy.
Why this exists:
transport/grpc.clj for the gory
details) cannot kill a connection that doesn't outlive a request.java.net.http is the repo's standard HTTP client (see
hive-mcp/src/hive_mcp/embeddings/openrouter.clj for the canonical
pattern).NOTE on Connection: close: java.net.http explicitly rejects the
Connection header as restricted (throws IllegalArgumentException).
The JDK's HTTP/1.1 client manages connection reuse internally and the
default pool's idle timeout is short; combined with our per-record
client lifetime (one with-client scope), idle-state exposure is
negligible. If a deployment sees gVisor-class idle kills even on
HTTP, the mitigation is to open a fresh HttpClient per request —
trivial to add later by moving builder construction into http-post.
Implements IMilvusCore + IMilvusAdmin. IMilvusExtras methods throw
— hive-milvus doesn't call them and PR-2 scope forbids gold-plating.
Return shapes are LSP-equivalent to transport/grpc.clj — every
protocol method here produces the same keyword-keyed map shape as the
gRPC do-* helpers, so a conformance suite can swap transports
transparently.
Loaded lazily via requiring-resolve from milvus-clj.client/make.
HTTP/REST transport for `milvus-clj.client`. Talks Milvus v2.5.x REST API
on port 19530 (yes, the same port as gRPC — Milvus 2.5+ multiplexes via
the proxy) via `java.net.http.HttpClient` + `clojure.data.json`.
PORT GOTCHA: do NOT use 9091. That's the metrics/health endpoint and
returns `404 page not found` on every REST API call. Milvus 2.5+ serves
gRPC and the v2 REST API on the SAME port (19530) via the proxy.
Why this exists:
- HTTP/1.1 with short-lived connections has zero idle state; the
gVisor netstack idle-sweep (see `transport/grpc.clj` for the gory
details) cannot kill a connection that doesn't outlive a request.
- `java.net.http` is the repo's standard HTTP client (see
`hive-mcp/src/hive_mcp/embeddings/openrouter.clj` for the canonical
pattern).
NOTE on `Connection: close`: java.net.http explicitly rejects the
`Connection` header as restricted (throws `IllegalArgumentException`).
The JDK's HTTP/1.1 client manages connection reuse internally and the
default pool's idle timeout is short; combined with our per-record
client lifetime (one `with-client` scope), idle-state exposure is
negligible. If a deployment sees gVisor-class idle kills even on
HTTP, the mitigation is to open a fresh `HttpClient` per request —
trivial to add later by moving builder construction into `http-post`.
Implements `IMilvusCore` + `IMilvusAdmin`. `IMilvusExtras` methods throw
— hive-milvus doesn't call them and PR-2 scope forbids gold-plating.
Return shapes are LSP-equivalent to `transport/grpc.clj` — every
protocol method here produces the same keyword-keyed map shape as the
gRPC `do-*` helpers, so a conformance suite can swap transports
transparently.
Loaded lazily via `requiring-resolve` from `milvus-clj.client/make`.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |