use of org.folio.kafka.GlobalLoadSensor in project mod-inventory by folio-org.
the class QuickMarcConsumerVerticle method createKafkaConsumer.
private Future<KafkaConsumerWrapper<String, String>> createKafkaConsumer(KafkaConfig kafkaConfig, QMEventTypes eventType, AsyncRecordHandler<String, String> recordHandler) {
var subscriptionDefinition = createSubscriptionDefinition(kafkaConfig.getEnvId(), getDefaultNameSpace(), eventType.name());
KafkaConsumerWrapper<String, String> consumerWrapper = KafkaConsumerWrapper.<String, String>builder().context(context).vertx(vertx).kafkaConfig(kafkaConfig).loadLimit(loadLimit).globalLoadSensor(new GlobalLoadSensor()).subscriptionDefinition(subscriptionDefinition).build();
return consumerWrapper.start(recordHandler, ConsumerWrapperUtil.constructModuleName()).map(consumerWrapper);
}
use of org.folio.kafka.GlobalLoadSensor in project mod-inventory by folio-org.
the class DataImportConsumerVerticle method createKafkaConsumerWrapper.
private Future<KafkaConsumerWrapper<String, String>> createKafkaConsumerWrapper(KafkaConfig kafkaConfig, DataImportEventTypes eventType, AsyncRecordHandler<String, String> recordHandler) {
SubscriptionDefinition subscriptionDefinition = KafkaTopicNameHelper.createSubscriptionDefinition(kafkaConfig.getEnvId(), KafkaTopicNameHelper.getDefaultNameSpace(), eventType.value());
KafkaConsumerWrapper<String, String> consumerWrapper = KafkaConsumerWrapper.<String, String>builder().context(context).vertx(vertx).kafkaConfig(kafkaConfig).loadLimit(loadLimit).globalLoadSensor(new GlobalLoadSensor()).subscriptionDefinition(subscriptionDefinition).build();
return consumerWrapper.start(recordHandler, ConsumerWrapperUtil.constructModuleName()).map(consumerWrapper);
}
Aggregations