Skip to content

Commit

Permalink
The 'throttled' commit strategy requires substituting the built-in re…
Browse files Browse the repository at this point in the history
…balance listener.
  • Loading branch information
cescoffier committed Nov 9, 2020
1 parent 2dde78f commit d6fc10c
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
package io.quarkus.smallrye.reactivemessaging.kafka.deployment;

import io.quarkus.deployment.Feature;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.vertx.kafka.client.consumer.impl.KafkaReadStreamImpl;

public class SmallRyeReactiveMessagingKafkaProcessor {

@BuildStep
FeatureBuildItem feature() {
return new FeatureBuildItem(Feature.SMALLRYE_REACTIVE_MESSAGING_KAFKA);
}

@BuildStep
public void build(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
// Required for the throttled commit strategy
reflectiveClass.produce(
ReflectiveClassBuildItem.builder(KafkaReadStreamImpl.class)
.fields(true)
.methods(true)
.constructors(true)
.finalFieldsWritable(true)
.build());
}

}

0 comments on commit d6fc10c

Please sign in to comment.