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

Cannot connect to shared Data Index in Quarkus Dev Mode #3824

Open
d135-1r43 opened this issue Jan 8, 2025 · 0 comments
Open

Cannot connect to shared Data Index in Quarkus Dev Mode #3824

d135-1r43 opened this issue Jan 8, 2025 · 0 comments

Comments

@d135-1r43
Copy link

Describe the bug

When using two services that should share the same Quarkus Dev Service Data Index, the latter one cannot connect to it and prompts the error:

2025-01-08 13:21:25,238 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application: java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
        at io.quarkus.runtime.Application.start(Application.java:101)
        at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:121)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:116)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: io.vertx.core.VertxException: java.net.MalformedURLException: unknown protocol: localhost
        at io.vertx.ext.web.client.impl.WebClientBase.requestAbs(WebClientBase.java:138)
        at io.vertx.ext.web.client.WebClient.requestAbs(WebClient.java:254)
        at io.vertx.ext.web.client.WebClient.postAbs(WebClient.java:434)
        at org.kie.kogito.quarkus.workflow.devservices.DataIndexEventPublisher.publish(DataIndexEventPublisher.java:66)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
        at java.base/java.util.Collections$SynchronizedCollection.forEach(Collections.java:2351)
        at org.kie.kogito.quarkus.workflow.devservices.DataIndexEventPublisher.publish(DataIndexEventPublisher.java:117)
        at org.kie.kogito.event.impl.BaseEventManager.lambda$publish$0(BaseEventManager.java:58)
        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
        at org.kie.kogito.event.impl.BaseEventManager.publish(BaseEventManager.java:58)
        at org.kie.kogito.services.registry.ProcessDefinitionEventRegistry.register(ProcessDefinitionEventRegistry.java:77)
        at org.kie.kogito.quarkus.registry.ProcessDefinitionRegistration.onStartUp(ProcessDefinitionRegistration.java:51)
        at org.kie.kogito.quarkus.registry.ProcessDefinitionRegistration_Observer_onStartUp_lne3cFiO5I9wh5H9OTf8cQM_oRc.notify(Unknown Source)
        at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:351)
        at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:333)
        at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:80)
        at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:163)
        at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:114)
        at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
        at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
        ... 11 more
Caused by: java.net.MalformedURLException: unknown protocol: localhost
        at java.base/java.net.URL.<init>(URL.java:779)
        at java.base/java.net.URL.<init>(URL.java:654)
        at java.base/java.net.URL.<init>(URL.java:590)
        at io.vertx.ext.web.client.impl.ClientUri.parse(ClientUri.java:38)
        at io.vertx.ext.web.client.impl.WebClientBase.requestAbs(WebClientBase.java:136)
        ... 30 more

Expected behavior

It should connect to the already existing Dev Service.

Actual behavior

It does not connect to the already existing Dev Services and fails with an execption.

How to Reproduce?

Reproduction is possible with an example project at https://github.com/d135-1r43/restaurant-complaints

  1. cd to de.thi.complaints and run mvn quarkus:dev
  2. cd to de.thi.sentiment and run mvn quarkus:dev
  3. experience the exception

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)

10.0.0

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.8

Additional information

Solution: Either the Extension must set config value kogito.data-index.url with protocol handler http or the class org.kie.kogito.quarkus.workflow.devservices.DataIndexEventPublisher must handle URLs without protocol handler and default to http.

I could do a PR if you want, yet I need someone to verify the (expected) behaviour first.

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