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

Apicurio Registry DevService cannot be used by multiple Quarkus services #24008

Closed
sombraglez opened this issue Feb 28, 2022 · 4 comments · Fixed by #24142
Closed

Apicurio Registry DevService cannot be used by multiple Quarkus services #24008

sombraglez opened this issue Feb 28, 2022 · 4 comments · Fixed by #24142
Assignees
Labels
area/kafka kind/bug Something isn't working
Milestone

Comments

@sombraglez
Copy link

Describe the bug

Currently I'm trying to connect two simple Quarkus services using the default DevServices as Kafka broker and schema registry. According to the logs both services can successfully find the DevServices, which are automatically started by Quarkus. However, by trying to send a first message into the configured topic the following error occurs:

ERROR [io.sma.rea.mes.kafka] (smallrye-kafka-producer-thread-0) SRMSG18260: Unable to recover from the serialization failure (topic: movies), configure a SerializationFailureHandler to recover from errors.: io.vertx.core.VertxException: Invalid url: localhost:64263/apis/registry/v2/groups/default/artifacts?ifExists=RETURN_OR_UPDATE&canonical=false
        at io.vertx.core.http.RequestOptions.parseUrl(RequestOptions.java:357)
        at io.vertx.core.http.RequestOptions.setAbsoluteURI(RequestOptions.java:370)
        at io.apicurio.rest.client.VertxHttpClient.sendRequest(VertxHttpClient.java:74)
        at io.apicurio.registry.rest.client.impl.RegistryClientImpl.createArtifact(RegistryClientImpl.java:236)
        at io.apicurio.registry.rest.client.RegistryClient.createArtifact(RegistryClient.java:139)
        at io.apicurio.registry.serde.DefaultSchemaResolver.lambda$handleAutoCreateArtifact$2(DefaultSchemaResolver.java:174)
        at io.apicurio.registry.serde.ERCache.lambda$getValue$0(ERCache.java:132)
        at io.apicurio.registry.serde.ERCache.retry(ERCache.java:171)
        at io.apicurio.registry.serde.ERCache.getValue(ERCache.java:131)
        at io.apicurio.registry.serde.ERCache.getByContent(ERCache.java:116)
        at io.apicurio.registry.serde.DefaultSchemaResolver.handleAutoCreateArtifact(DefaultSchemaResolver.java:172)
        at io.apicurio.registry.serde.DefaultSchemaResolver.resolveSchema(DefaultSchemaResolver.java:82)
        at io.apicurio.registry.serde.AbstractKafkaSerializer.serialize(AbstractKafkaSerializer.java:92)
        at io.smallrye.reactive.messaging.kafka.fault.SerializerWrapper.lambda$serialize$1(SerializerWrapper.java:56)
        at io.smallrye.reactive.messaging.kafka.fault.SerializerWrapper.wrapSerialize(SerializerWrapper.java:81)
        at io.smallrye.reactive.messaging.kafka.fault.SerializerWrapper.serialize(SerializerWrapper.java:56)
        at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:945)
        at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:905)
        at io.smallrye.reactive.messaging.kafka.impl.ReactiveKafkaProducer.lambda$send$3(ReactiveKafkaProducer.java:111)
        at io.smallrye.context.impl.wrappers.SlowContextualConsumer.accept(SlowContextualConsumer.java:21)
        at io.smallrye.mutiny.operators.uni.builders.UniCreateWithEmitter.subscribe(UniCreateWithEmitter.java:22)
        at io.smallrye.mutiny.operators.AbstractUni.subscribe(AbstractUni.java:36)
        at io.smallrye.mutiny.operators.uni.UniRunSubscribeOn.lambda$subscribe$0(UniRunSubscribeOn.java:27)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.net.MalformedURLException: unknown protocol: localhost
        at java.base/java.net.URL.<init>(URL.java:652)
        at java.base/java.net.URL.<init>(URL.java:541)
        at java.base/java.net.URL.<init>(URL.java:488)
        at io.vertx.core.http.RequestOptions.parseUrl(RequestOptions.java:355)
        ... 25 more

This error only occurs on the Quarkus service (consumer or producer), which connects to an already existing Apicurio Registry started as Devservice.

Expected behavior

Multiple Quarkus Services in Dev mode can connect to an existing Apicurio Registry DevService automatically started by one of them

Actual behavior

The configured URL to an Apicurio Registry DevService contains no protocol for those services, which try to connect an existing instance of the DevService

How to Reproduce?

Using following consumer and producer services:

https://github.com/sombraglez/quarkus-kafka-avro-schema-consumer
https://github.com/sombraglez/quarkus-kafka-avro-schema-producer

  1. Start consumer quarkus-kafka-avro-schema-consumer in Dev mode mvn quarkus:dev
  2. Start producer quarkus-kafka-avro-schema-producer in Dev mode mvn quarkus:dev
  3. Access consumer REST-EndPoint http://localhost:8081/consumed-movies
  4. Produce a message via POST at http://localhost:8080/movies

Output of uname -a or ver

No response

Output of java -version

openjdk 11.0.14 2022-01-18 LTS

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.2.Final

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

Apache Maven 3.8.2

Additional information

No response

@sombraglez sombraglez added the kind/bug Something isn't working label Feb 28, 2022
@edeandrea
Copy link
Contributor

+1 to this as well as this affects the superheroes sample app (https://github.com/quarkusio/quarkus-super-heroes). That app is using Quarkus version 2.7.3.Final.

@edeandrea
Copy link
Contributor

/cc @cescoffier @carlesarnal

@cescoffier
Copy link
Member

@edeandrea @sombraglez - See #24142.

@sombraglez thank you for the reproducer!

@quarkus-bot
Copy link

quarkus-bot bot commented Mar 8, 2022

/cc @cescoffier, @ozangunalp

@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Mar 8, 2022
@gsmet gsmet modified the milestones: 2.8 - main, 2.7.4.Final Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kafka kind/bug Something isn't working
Projects
None yet
4 participants