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

Read initial delay parameter to register instance #68

Open
A694569 opened this issue Nov 20, 2024 · 0 comments
Open

Read initial delay parameter to register instance #68

A694569 opened this issue Nov 20, 2024 · 0 comments

Comments

@A694569
Copy link

A694569 commented Nov 20, 2024

Hello, @fmcejudo

I have an application that uses Kafka and because of this, the initialization takes a little longer than normal.
Because of this, the service is not registered in Eureka and displays the error Health check not reachable: ...
When checking the code, I found that the value of 2 seconds was fixed and I was not getting it from application.properties

I made the modification below and this problem was solved. Could you analyze it to include it in the default branch and generate a new version?

Screenshot 2024-11-20 at 10 48 10 AM

Screenshot 2024-11-20 at 10 48 33 AM

This way, the application can set a different value for the initial delay, as can be seen in the log below, where the value of 15 seconds was used.

My configuration:

  eureka:
    region: default
    prefer-same-zone: true
    should-use-dns: false
    service-url:
      default: ${EUREKA_URL:http://localhost:8761/eureka}
    metadata:
      app-key: ocr-service
    heartbeat:
      enabled: true
      health-path: /info/health
      status-path: /info/status
    hostname: ${QUARKUS_EUREKA_HOSTNAME:localhost}
    health-check-initial-delay: 15

Output:

2024-11-20 10:19:41                                                                           Powered by Quarkus 3.13.1
2024-11-20 13:19:41,786 WARN  [io.qua.run.con.ConfigRecorder] (main) Build time property cannot be changed at runtime:
2024-11-20 10:19:41  - quarkus.swagger-ui.always-include is set to 'true' but it is build time fixed to 'false'. Did you change the property quarkus.swagger-ui.always-include after building the application?
2024-11-20 13:19:42,126 INFO  [io.qua.eur.EurekaRecorder] (main) registering eurekaService
2024-11-20 13:19:45,142 INFO  [io.quarkus] (main) my-service 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.13.1) started in 8.751s. Listening on: http://0.0.0.0:8181
2024-11-20 13:19:45,150 INFO  [io.quarkus] (main) Profile prod activated. 
2024-11-20 13:19:45,156 INFO  [io.quarkus] (main) Installed features: [agroal, azure-storage-blob, cdi, eureka, hibernate-orm, hibernate-orm-panache, jdbc-postgresql, kafka-client, messaging, messaging-kafka, narayana-jta, oidc, rest, rest-client, rest-client-jackson, rest-jackson, rest-jsonb, security, servlet, smallrye-context-propagation, smallrye-openapi, spring-cloud-config-client, vertx]
2024-11-20 13:19:57,515 INFO  [io.qua.eur.ope.reg.RegisterOperation] (pool-5-thread-1) Service has been registered in http://discovery-service:8761/eureka

If there is another way to achieve this delay, I am open to suggestions...

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

1 participant