https://github.com/range79/range-meili-validator
https://github.com/range79/range-meili-validator
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/range79/range-meili-validator
- Owner: range79
- License: mit
- Created: 2026-01-24T07:18:36.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-02-15T00:46:07.000Z (2 months ago)
- Last Synced: 2026-02-15T08:11:54.643Z (2 months ago)
- Language: Java
- Size: 213 KB
- Stars: 6
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# range Meilisearch Startup Validator
Idea credit: Chris
## Latest version
[](https://jitpack.io/#range79/Chris-meili-validator)
This library solves a simple but annoying problem:
Spring Boot starts.
Meilisearch is not fully ready yet.
Your application crashes because it tries to use Meili too early.
This validator blocks application startup until Meilisearch is actually healthy.
---
## Modules
This project is split into two modules:
### core
- Pure Java
- No Spring dependency
- Can be used in any JVM application
- Manually triggered validation
### spring
- Spring Boot integration
- Automatically runs validation during application startup
- Depends on `core` (you don’t need to add `core` manually)
---
## Installation
### Maven
Add JitPack repository:
```xml
jitpack.io
https://jitpack.io
````
#### Core only
```xml
com.github.range79
range-meili-validator-core
1.6.1
```
#### Spring Boot integration
```xml
com.github.range79
range-meili-validator-spring
1.6.1
```
---
### Gradle
Add JitPack repository:
```gradle
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
```
#### Core only
```gradle
implementation("com.github.range79:range-meili-validator-core:1.6.1")
```
#### Spring Boot integration
```gradle
implementation("com.github.range79:range-meili-validator-spring:1.6.1")
```
When you use the Spring module, `core` is included automatically.
---
## Configuration (Spring Boot)
Set Meili search URL in your application configuration:
```properties
meili.startup.url= like(http://localhost:7070)(default url is https://localhost:7070)
```
Optional settings:
```properties
# How often (in seconds) the system checks whether Meilisearch is ready.
# Default: 1
# Increasing this value is recommended when log-mode is enabled,
# because very small intervals may cause excessive log output.
meili.startup.interval=
# Maximum time (in seconds) to wait for Meili search to become ready.
# Default: 30
meili.startup.timeout=
# Optional API key.
# Only set this if your Meilisearch instance was started with an API key.
meili.startup.api-key=YOUR_MEILI_API_KEY
```
# what is interval ?
interval is the frequency at which requests are sent during the timeout period.
In other words, it defines how often the system should check Meili until the timeout is reached.
## ⚠Disclaimer: Master API Key Required
**Important:** If your Meilisearch instance requires a master API key:
- **Invalid API key**, or
- **No API key provided** while the instance enforces authentication
will cause the application to **terminate immediately**.
The validator will log a clear error message and then call:
```java
System.exit(1);
```
This ensures the application does **not continue running without proper authentication**, preventing any unsafe attempts to query Meilisearch.