MongoHealthIndicator

@Singleton
@Requires(beans = [MongoClient::class])
@Requires(property = "endpoints.health.mongodb.enabled", notEquals = "false")
class MongoHealthIndicator(mongoClient: MongoClient) : AbstractHealthIndicator<Map<String, Any>>

Reports MongoDB connectivity on the /health endpoint.

Micronaut only ships a Mongo health indicator for the reactive driver; these services use micronaut-data-mongodb on the synchronous driver, so /health would otherwise never reflect the database. This runs a lightweight ping against the already-wired sync MongoClient.

Disable with endpoints.health.mongodb.enabled: false.

Constructors

Link copied to clipboard
constructor(mongoClient: MongoClient)

Properties

Link copied to clipboard
open val order: Int
Link copied to clipboard
open override val result: Publisher<HealthResult?>?

Functions

Link copied to clipboard
@Inject
open fun setExecutorService(@Named(value = "blocking") executorService: ExecutorService?)