Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriOndrusek committed Jun 29, 2021
1 parent 37778ac commit b7eac39
Show file tree
Hide file tree
Showing 11 changed files with 832 additions and 21 deletions.
4 changes: 4 additions & 0 deletions extensions/avro-rpc/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
<artifactId>quarkus-avro-deployment</artifactId>
<groupId>io.quarkus</groupId>
</dependency>
<dependency>
<artifactId>quarkus-vertx-http-deployment</artifactId>
<groupId>io.quarkus</groupId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
*/
package org.apache.camel.quarkus.component.avro.rpc.deployment;

import java.nio.file.Paths;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.avro.specific.AvroGenerated;
import org.apache.camel.quarkus.component.avro.rpc.spi.VertxHttpServerFactory;
import org.apache.camel.quarkus.core.deployment.spi.CamelServiceBuildItem;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.DotName;
import org.jboss.jandex.IndexView;
Expand All @@ -37,7 +41,8 @@ FeatureBuildItem feature() {
}

@BuildStep
ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex,
BuildProducer<ReflectiveClassBuildItem> reflectiveClassProducer) {
IndexView index = combinedIndex.getIndex();
String[] dtos = index.getAnnotations(DotName.createSimple(AvroGenerated.class.getName())).stream()
.filter(a -> a.target().kind() == AnnotationTarget.Kind.CLASS)
Expand All @@ -51,4 +56,10 @@ ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIn
void registerDependencyForIndex(BuildProducer<IndexDependencyBuildItem> indexDependency) {
indexDependency.produce(new IndexDependencyBuildItem("org.apache.avro", "avro-ipc"));
}

@BuildStep
CamelServiceBuildItem httpFactory() {
return new CamelServiceBuildItem(Paths.get("META-INF/services/org/apache/camel/avro-rpc-http-server-factory"),
VertxHttpServerFactory.class.getName());
}
}
14 changes: 11 additions & 3 deletions extensions/avro-rpc/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,27 @@
<artifactId>*</artifactId>
<groupId>org.apache.avro</groupId>
</exclusion>
<exclusion>
<artifactId>camel-avro-rpc-jetty</artifactId>
<groupId>org.apache.camel</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-avro-rpc-spi</artifactId>
</dependency>
<dependency>
<artifactId>quarkus-avro</artifactId>
<groupId>io.quarkus</groupId>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-ipc-netty</artifactId>
<artifactId>quarkus-vertx-http</artifactId>
<groupId>io.quarkus</groupId>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-ipc-jetty</artifactId>
<artifactId>avro-ipc-netty</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
Expand Down

0 comments on commit b7eac39

Please sign in to comment.