Akshay Jain
Akshay Jain

Reputation: 1

Is there any way to disable or override the default readiness in quarkus(health check) for elastic search

Is there any way to disable or override the default readiness in quarkus(health check) for elastic search.

I am using quarkus-elasticsearch-rest-client and quarkus have default health check for it. I want to disable health check in non-prod env.

I have tried with configuring this in yml quarkus.elasticsearch.health.enabled = false but it is not working

I have tried this quarkus.elasticsearch.health.enabled = false but it is still doing health check

Upvotes: 0

Views: 209

Answers (1)

yrodiere
yrodiere

Reputation: 9977

quarkus.elasticsearch.health.enabled is a build-time property, as highlighted by the lock icon in the docs.

If you override this property at runtime, the override will be ignored and you will get a warning about it on startup.

As things stand, if you want a different behavior in staging than in prod, you need a dedicated profile at build time.

E.g., configure a custom staging profile extending prod:

"%prod":
  quarkus:
    elasticsearch:
      health:
        enabled: true

"%staging":
  quarkus:
    config:
      profile:
        # Staging config defaults to prod config, unless overridden below
        parent: prod
    elasticsearch:
      health:
        enabled: false

And when building the app for deployment in staging, set the Quarkus profile explicitly through environment variables (QUARKUS_PROFILE=staging) or Maven system properties (-Dquarus.profile=staging).


Also, in YAML this won't work:

quarkus.elasticsearch.health.enabled: false

You really need to do this instead:

quarkus:
  elasticsearch:
    health:
      enabled: false

Upvotes: 1

Related Questions