Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consul reports health check problems when an application is configured for Consul to check application health instead of the application sending heartbeat #258

Open
3 of 4 tasks
el-duderino5 opened this issue Jun 10, 2021 · 0 comments

Comments

@el-duderino5
Copy link

el-duderino5 commented Jun 10, 2021

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Use https://micronaut.io/launch to make a new Micronaut project, and select config-consul and discovery-consul features
  2. Install consul through docker and add the following configuration to bootstrap.yml and application.yml. The configuration in application.yml tells the application that Consul is the one who checks for the health of the application instead of the application sending the heartbeat to Consul:

bootstrap.yml

micronaut:
  application:
    name: demoApp
  config-client:
    enabled: true

application.yml

consul:
  client:
    registration:
      enabled: true
      check:
        http: true
    default-zone: "${CONSUL_HOST:localhost}:${CONSUL_PORT:8500}"
  1. Build and run the application

Expected Behaviour

On Consul's web client you should see that the application is running with no problems.

Actual Behaviour

Under health checks tab for the service, Consul's web client reports the following:

Get "http://localhost:8080/health": dial tcp 127.0.0.1:8080: connect: connection refused

Environment Information

  • Operating System: Debian Buster
  • Micronaut Version: 2.5.5
  • JDK Version: 11.0.11

Example Application

I would also like to report that there are currently inconsistencies in what is stated in the guide with respect to Consul configuration and what https://micronaut.io/launch configures for service discovery with Consul. On the official Micronaut Discovery Client guide page, it is stated that implementation("io.micronaut:micronaut-discovery-client") is needed to add the discovery client to the application but, checking what is generated with the launcher, the dependency is instead the following: implementation("io.micronaut.discovery:micronaut-discovery-client").

I have attached a picture that describes the problem.

Screenshot from 2021-06-10 17-36-23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants