You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Currently, the Config class in the Meilisearch Java SDK initializes a default HttpClient as a final field, with no way to inject a custom OkHttpClient instance. This prevents users from configuring advanced HTTP settings such as custom timeouts, connection pooling, interceptors (e.g., logging, retry logic), or proxy configurations — which are essential for production-grade applications.
Basic example
I would like to be able to pass a pre-configured OkHttpClient to the Config class, like this:
Config config = new Config("http://localhost:7700", "masterKey", customClient);
MeiliSearchClient client = new MeiliSearchClient(config);
Currently, this is not possible because Config only accepts hostUrl and apiKey, and internally creates a fixed HttpClient. Adding a constructor that accepts an OkHttpClient (or HttpClient interface) would enable full control over HTTP behavior.
Other
This change would improve flexibility for enterprise users who need custom HTTP behavior (e.g., TLS config, corporate proxies, monitoring).
The change is backward-compatible — existing code continues to work with the default constructor.
Activity
brunoocasali commentedon Jan 19, 2026
Hi there, it would be amazing indeed to have this level of customization PR's are welcome 🙏