Skip to content

Commit

Permalink
Use Quarkus-provided Kafka client, increase allowed event loop exec time
Browse files Browse the repository at this point in the history
Minor adjustments to allow native executable:
- Add `@RegisterForReflection` to `OperationsHandler`
- Provide default to `kafka.admin.oauth.enabled`
  • Loading branch information
MikeEdgar committed Jul 29, 2022
1 parent 760e1fb commit a8f5457
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 4 additions & 0 deletions kafka-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-kafka-client</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-annotation</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.bf2.admin.kafka.admin.handlers;

import io.quarkus.runtime.annotations.RegisterForReflection;
import org.bf2.admin.kafka.admin.Operations;
import org.bf2.admin.kafka.admin.model.Types;
import org.eclipse.microprofile.openapi.annotations.Operation;
Expand Down Expand Up @@ -29,6 +30,7 @@
import java.util.Optional;
import java.util.concurrent.CompletionStage;

@RegisterForReflection
public interface OperationsHandler {

@POST
Expand Down
8 changes: 3 additions & 5 deletions kafka-admin/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ quarkus.http.ssl.certificate.key-file=${kafka.admin.tls.key:}

# See https://quarkus.io/guides/kafka-dev-services
# Enable when using quarkus-kafka-client
#quarkus.kafka.devservices.enabled=false
quarkus.kafka.devservices.enabled=false

# Remove when quarkus-kafka-client supports Kafka client 3.0
quarkus.index-dependency.kafka-clients.group-id=org.apache.kafka
quarkus.index-dependency.kafka-clients.artifact-id=kafka-clients
quarkus.vertx.max-event-loop-execute-time=4000

# The following properties will be used when adding JWT RBAC provided by quarkus-smallrye-jwt
quarkus.smallrye-jwt.enabled=true
Expand All @@ -45,7 +43,7 @@ quarkus.swagger-ui.theme=monokai

quarkus.log.category."org.apache.kafka".level=WARN

kafka.admin.oauth.enabled=${quarkus.smallrye-jwt.enabled}
kafka.admin.oauth.enabled=${quarkus.smallrye-jwt.enabled:true}
# Default limit to the number of partitions that new topics may have configured.
kafka.admin.num.partitions.max=100
# Default resource/operations mapping
Expand Down
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<!-- Dependencies -->
<quarkus.version>2.7.6.Final</quarkus.version>
<jandex-maven-plugin.version>1.2.1</jandex-maven-plugin.version>
<kafka.version>3.0.0</kafka.version>
<strimzi-oauth.version>0.8.1</strimzi-oauth.version>
<smallrye.jwt.version>3.5.3</smallrye.jwt.version>
<hamcrest.version>2.1</hamcrest.version>
Expand Down Expand Up @@ -70,11 +69,6 @@
<artifactId>kafka-admin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>${kafka.version}</version>
</dependency>
<dependency>
<groupId>io.strimzi</groupId>
<artifactId>kafka-oauth-client</artifactId>
Expand Down

0 comments on commit a8f5457

Please sign in to comment.