diff --git a/spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java b/spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java index a25d64ff37..9df6a3b13e 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java @@ -818,7 +818,7 @@ private List resolveTopicPartitionsList(TopicPartition top for (String partition : partitions) { resolvePartitionAsInteger((String) topic, resolveExpression(partition), result, null, false, false); } - if (partitionOffsets.length == 1 && partitionOffsets[0].partition().equals("*")) { + if (partitionOffsets.length == 1 && resolveExpression(partitionOffsets[0].partition()).equals("*")) { result.forEach(tpo -> { tpo.setOffset(resolveInitialOffset(tpo.getTopic(), partitionOffsets[0])); tpo.setRelativeToCurrent(isRelative(tpo.getTopic(), partitionOffsets[0]));