Tika gRPC
Tika gRPC parses documents over gRPC, for microservice architectures and polyglot environments.
The service definition lives in tika-grpc/src/main/proto/tika.proto. Clients register a fetcher
(SaveFetcher) and then submit FetchAndParseRequest messages, each returning a
FetchAndParseReply with extracted metadata and content. Streaming variants
(FetchAndParseServerSideStreaming, FetchAndParseBiDirectionalStreaming) return the same reply
type.
Concurrency
FetchAndParse and its streaming variants run on a pool of forked JVMs sized by
pipes.numClients (default: derived from host cores, at most 4). A call that cannot get a fork
within pipes.maxWaitForClientMillis (default 60s) returns the in-band reply status
CLIENT_UNAVAILABLE_WITHIN_MS — at capacity, not failing. pipes.useSharedServer: true shares one
JVM instead.
Command-line options
| Option | Description |
|---|---|
|
Listen port. Default |
|
Tika config file. |
|
Tika Pipes plugins config file. |
|
Comma-separated plugin root directories; overrides the config file. |
|
Enable TLS. See Transport Security. |
|
Server certificate chain file, e.g. |
|
Server private key file, e.g. |
|
Password for the private key, if it is encrypted. |
|
Root certificates used to verify client certificates, e.g. |
|
Require mutual TLS. Implies |
|
Display the help menu. |
Security
|
The primary rule is trusted callers only. tika-grpc is even more exposed by default than
tika-server: no transport security, no per-caller authorization, and its core Its most dangerous capabilities — runtime mutation of the fetcher/iterator store (for example
|
Capability flags
Both flags live in the grpc section of your tika-config and default to false. Out of the box
the server only fetches and parses using the fetchers and pipes iterators declared in the config
file, with the server’s own parse configuration.
| Setting | Description |
|---|---|
|
When |
|
When |
Enable these only for trusted callers over a secured channel:
{
"grpc": {
"allowPerRequestConfig": true,
"allowComponentManagement": true
}
}
Transport security (TLS)
TLS is configured entirely through command-line flags; there is no JSON config for it. Three modes:
Insecure (default). No --secure flag: plaintext and unauthenticated. This includes the
apache/tika-grpc Docker image, whose entrypoint does not pass --secure. Trusted networks only.
Server (1-way) TLS. The server authenticates to clients; clients are not authenticated.
java -jar tika-grpc-<version>.jar --secure \
--cert-chain server.pem --private-key server.key
Mutual (2-way) TLS. Additionally supply the CA used to verify client certificates, and require
client authentication. --client-auth-required implies --secure — it is spelled out here for
clarity.
java -jar tika-grpc-<version>.jar --secure \
--cert-chain server.pem --private-key server.key \
--trust-cert-collection ca.pem --client-auth-required
When running the Docker image, append these flags to the container command — they are forwarded to the server — and mount the certificate files into the container.
Kubernetes and service meshes
Kubernetes does not make tika-grpc safe on its own. Pod networking is flat by default: any pod can reach any other pod’s port, traffic is unencrypted, and there is no authentication or authorization between pods. Two separate controls matter, and neither is applied automatically:
-
Transport security. A service mesh (Istio, Linkerd) with sidecar mTLS encrypts and authenticates pod-to-pod traffic. Where the mesh provides this, you can run tika-grpc without
--secureand let the mesh handle transport security instead of the TLS flags above. -
Reachability. A
NetworkPolicyadmitting only your trusted clients to the tika-grpc Service. This is the control that actually mitigates the exposure: because tika-grpc has no per-caller authorization, the set of pods that can reach the port is effectively the set of pods that can use its enabled RPC surface.
Mesh mTLS authenticates who opened the connection; it does not authorize what that caller may
do. An authenticated-but-untrusted pod can still invoke whatever RPC surface is enabled — at
minimum FetchAndParse against your configured fetchers, plus the component-management RPCs (and
the config reads that can expose stored secrets) if allowComponentManagement is set. A
NetworkPolicy is therefore required, not optional.
Per-request ParseContext
FetchAndParseRequest.parse_context_json overrides the server’s default ParseContext for one
request. Keys are parse-context component names; values are their JSON configs.
{
"basic-content-handler-factory": {"type": "HTML"},
"timeout-limits": {"progressTimeoutMillis": 30000}
}
See META-INF/tika/parse-context.idx (generated at build time from @TikaComponent annotations)
for the available component names.
This is disabled by default. A request setting parse_context_json or
additional_fetch_config_json is rejected with PERMISSION_DENIED unless allowPerRequestConfig
is enabled — see Capability flags.
|