Skip to content

Commit 16c3f2f

Browse files
garyrussellartembilan
authored andcommitted
Some fixes for current code base state
* Fix `KafkaAdmin` to use `Collections.singletonMap()` instead of `Map.of()` which is not available for Java 8 yet * Fix `DefaultErrorHandlerNoSeeksRecordAckNoResumeTests` for the current `RecordInterceptor` lambda
1 parent a24a263 commit 16c3f2f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

spring-kafka/src/main/java/org/springframework/kafka/core/KafkaAdmin.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,9 @@ private void adjustConfigMismatches(AdminClient adminClient, Collection<NewTopic
342342
}
343343
if (alterConfigOperations.size() > 0) {
344344
try {
345-
AlterConfigsResult alterConfigsResult = adminClient
346-
.incrementalAlterConfigs(Map.of(topicConfigResource, alterConfigOperations));
345+
AlterConfigsResult alterConfigsResult =
346+
adminClient.incrementalAlterConfigs(
347+
Collections.singletonMap(topicConfigResource, alterConfigOperations));
347348
alterConfigsResult.all().get(this.operationTimeout, TimeUnit.SECONDS);
348349
}
349350
catch (InterruptedException ie) {

spring-kafka/src/test/java/org/springframework/kafka/listener/DefaultErrorHandlerNoSeeksRecordAckNoResumeTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ ConcurrentKafkaListenerContainerFactory kafkaListenerContainerFactory(KafkaListe
227227
factory.setConsumerFactory(consumerFactory(registry));
228228
factory.getContainerProperties().setAckMode(AckMode.RECORD);
229229
factory.getContainerProperties().setDeliveryAttemptHeader(true);
230-
factory.setRecordInterceptor((record, consumer) -> {
230+
factory.setRecordInterceptor((record) -> {
231231
Config.this.deliveryAttempt = record.headers().lastHeader(KafkaHeaders.DELIVERY_ATTEMPT);
232232
return record;
233233
});

0 commit comments

Comments
 (0)