Skip to content

Commit

Permalink
review: renamed consumerRestartBackOffConfig to restartBackOffConfig
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Sep 7, 2021
1 parent 27fedfb commit 2e09be3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ final class DefaultKafkaConsumerConfig implements KafkaConsumerConfig {
private static final String RESTART_PATH = "restart";

private final ConnectionThrottlingConfig throttlingConfig;
private final ExponentialBackOffConfig consumerRestartBackOffConfig;
private final ExponentialBackOffConfig restartBackOffConfig;
private final Config alpakkaConfig;

private DefaultKafkaConsumerConfig(final Config kafkaConsumerScopedConfig) {
throttlingConfig = ConnectionThrottlingConfig.of(kafkaConsumerScopedConfig);
consumerRestartBackOffConfig =
restartBackOffConfig =
DefaultExponentialBackOffConfig.of(getConfigOrEmpty(kafkaConsumerScopedConfig, RESTART_PATH));
alpakkaConfig = getConfigOrEmpty(kafkaConsumerScopedConfig, ALPAKKA_PATH);
}
Expand All @@ -64,8 +64,8 @@ public ConnectionThrottlingConfig getThrottlingConfig() {
}

@Override
public ExponentialBackOffConfig getConsumerRestartBackOffConfig() {
return consumerRestartBackOffConfig;
public ExponentialBackOffConfig getRestartBackOffConfig() {
return restartBackOffConfig;
}

@Override
Expand All @@ -83,20 +83,20 @@ public boolean equals(final Object o) {
}
final DefaultKafkaConsumerConfig that = (DefaultKafkaConsumerConfig) o;
return Objects.equals(throttlingConfig, that.throttlingConfig) &&
Objects.equals(consumerRestartBackOffConfig, that.consumerRestartBackOffConfig) &&
Objects.equals(restartBackOffConfig, that.restartBackOffConfig) &&
Objects.equals(alpakkaConfig, that.alpakkaConfig);
}

@Override
public int hashCode() {
return Objects.hash(throttlingConfig, consumerRestartBackOffConfig, alpakkaConfig);
return Objects.hash(throttlingConfig, restartBackOffConfig, alpakkaConfig);
}

@Override
public String toString() {
return getClass().getSimpleName() + " [" +
"throttlingConfig=" + throttlingConfig +
", consumerRestartBackOffConfig=" + consumerRestartBackOffConfig +
", restartBackOffConfig=" + restartBackOffConfig +
", alpakkaConfig=" + alpakkaConfig +
"]";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface KafkaConsumerConfig {
*
* @return the config.
*/
ExponentialBackOffConfig getConsumerRestartBackOffConfig();
ExponentialBackOffConfig getRestartBackOffConfig();

/**
* Returns the Config for consumers needed by the Kafka client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private Stream<ConsumerData> consumerDataFromSource(final Source source) {
private void startKafkaConsumer(final ConsumerData consumerData, final boolean dryRun) {
final KafkaConsumerConfig consumerConfig = kafkaConfig.getConsumerConfig();
final ConnectionThrottlingConfig throttlingConfig = consumerConfig.getThrottlingConfig();
final ExponentialBackOffConfig consumerRestartBackOffConfig = consumerConfig.getConsumerRestartBackOffConfig();
final ExponentialBackOffConfig consumerRestartBackOffConfig = consumerConfig.getRestartBackOffConfig();
final KafkaConsumerStreamFactory streamFactory =
new KafkaConsumerStreamFactory(throttlingConfig, propertiesFactory, consumerData, dryRun);
final Props consumerActorProps =
Expand Down

0 comments on commit 2e09be3

Please sign in to comment.