Closed jdarosTD closed 2 years ago
Hi @jdarosTD , thanks for raising the issue. I haven't tried yet with Quarkus 1.5.2, I will give it a go today and see if I find out something.
Thanks @fmcejudo 👍
@jdarosTD, in a first try, I have run all tests again with Quarkus 1.4.2 and I didn't get any issue, after I have moved it on to Quarkus 1.5.2 and run again tests and I didn't get any issue either. What is the JVM you are running? Might we have a simple project to test these stuff? I was wondering if it is possible those endpoints are not ready yet when the plugin try to hit them.
@fmcejudo I was in jdk1.8 mvn 3.0.5. To test I've tried on jdk11 with mvn last release 3.6.3. Same error in test while building your project.
Actually i was working on quarkus 1.5.2 or 1.4.2 whatever, the problem still here. I've commented all controllers to only get the StatusResource as described in my post. Unfortunately I cannot give access to my code. Do you have any sample that i can try ? On a github repo for instance ?
Nota : i also use kotlin
here is one extract of my gradle project :
dependencies {
implementation 'io.quarkus:quarkus-resteasy-jackson'
implementation 'io.quarkus:quarkus-jackson'
// implementation 'io.quarkus:quarkus-spring-web'
implementation 'io.quarkus:quarkus-oidc'
implementation 'io.quarkus:quarkus-kotlin'
// implementation 'io.quarkus:quarkus-resteasy-jsonb'
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
// implementation 'io.quarkus:quarkus-resteasy'
implementation 'io.quarkus:quarkus-spring-di'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation 'io.quarkus:quarkus-spring-cloud-config-client'
implementation 'io.quarkus:quarkus-rest-client'
implementation 'com.github.fmcejudo:quarkus-eureka:0.0.9'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
implementation("com.squareup.okhttp3:logging-interceptor:4.3.1")
// implementation("com.squareup.okhttp3:okhttp:4.3.1")
implementation 'net.iakovlev:timeshape:2018d.6'
testImplementation 'io.quarkus:quarkus-junit5'
testImplementation 'io.rest-assured:rest-assured'
}
group '.....'
version '1.0.0-SNAPSHOT'
quarkus {
setOutputDirectory("$projectDir/build/classes/kotlin/main")
}
quarkusDev {
setSourceDir("$projectDir/src/main/kotlin")
}
allOpen {
annotation("javax.ws.rs.Path")
annotation("javax.enterprise.context.ApplicationScoped")
annotation("io.quarkus.test.junit.QuarkusTest")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
compileKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8
kotlinOptions.javaParameters = true
}
compileTestKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8
}
I have this project as example of using the quarkus-eureka:
https://github.com/currofy/coffee-shop-parent
which is using now Quarkus 1.5.2 and the most recent released plugin I did (0.0.9), I have started the three modules and they joined to eureka server. Can you try to clone those projects and check if they work for you?
Also I would recommend you to clean up your repository for this project:
mvn dependency:purge-local-repository
https://maven.apache.org/plugins/maven-dependency-plugin/examples/purging-local-repository.html
Just to make it easy you might tweak toolchains.xml and build with script build.sh
Then, just run eureka-server
with mvn spring-boot:run
and quarkus modules with mvn quarkus:dev
for both projects supplier
and client
, checking they are bound to eureka-server.
If you face any problem, let me know and we can check it
@fmcejudo thanks for your answer. I've successful started your example. What i don't really understand in theses is the configuration for the status and health pathes
as we can see here we've a reference of uri http://kubernetes.docker.internal:8001/ i was expecting using localhost I have not yet all the knowledge about this so, sorry if I misunderstand
I tried on a basic project, with maven, it works fine on my eureka server I will now try with a gradle project and see. I will keep you in touch about that. Maybe it's something about another dependency
Thanks for you help Regards
I see, this is something also happen to me at some point. I was in a very complicated network architecture in the office and somehow I was given a wrong DNS to point to my address in my host over wired network, but the right one in wireless.
https://github.com/fmcejudo/quarkus-eureka/issues/2
What I don't understand is why if you have property quarkus.eureka.host-name
to localhost
it does not apply to you.
Here is where that address should be built:
io.quarkus.eureka.config.EurekaRuntimeConfiguration.NetworkConverter
Related to that logic you pointed at, it means to check periodically the state of the the services and trying to register in Eureka if this was not in the list for the given locations. Scheduled every 40 seconds as the Eureka Server might not be ready yet (let's say you start the eureka as last service).
Please, keep my post if possible and if there is any issue we can try to fix it.
Thank you for giving a try and helping to improve the plugin.
Hello,
I have faced the same problem,
But in my case, I have several kafka endpoints and the app late to startup. For me the problem is the following code if app is not running, an exception is thrown and never try again, I think the catch should be silent and a health check after a period of time would get register to eureka:
private static class RegistrationFlow {
private static final Logger LOGGER = Logger.getLogger(RegistrationFlow.class.getName());
private Status status;
private RegistrationFlow(final Status status) {
this.status = status;
}
private static RegistrationFlow instanceHealthCheck(final Supplier<Status> statusSupplier) {
try {
return new RegistrationFlow(statusSupplier.get());
} catch (Exception e) {
// We need to log the errors in this thread, as this is inside of an Executor which is not bind to
// the main thread
LOGGER.warning(e.getMessage());
throw e;
}
}
private InstanceResult eurekaHealthCheck(final Supplier<InstanceResult> eurekaHealthSupplier) {
if (UP.equals(this.status)) {
return eurekaHealthSupplier.get();
}
return InstanceResult.error();
}
}
If change as follow work fine:
Hello. Firstly, thank you for this extension.
I've got actually a problem using it here is my configuration :
Here is my controller :
At startup I've got this error while everything works fine without the euraka dependency. Here no routes are available. I compiled the project myself thinking about the delay of 3 secondes inside EurekaRegistrationService could be not enough for the app to be ready, but nothing changed
I tried on quarkus 1.5.2.Final and 1.4.2.Final For information, while compiling the project and testing, i got a failed on
InstanceHealthCheckServiceTest#shouldWrapExceptionWithHealthCheckException and this error in particulary
'Throwable that failed the check:
io.quarkus.eureka.exception.HealthCheckException: Instance can't reach own application health check. Ensure this has been implemented'
Thanks for your interest Jonathan