Update documentation

fix code and bring it in line with the codebase
This commit is contained in:
Ilya Serbis
2023-04-05 14:16:26 +03:00
committed by Soby Chacko
parent a01bf30d38
commit 4b7ced0062

View File

@@ -74,15 +74,15 @@ public class KafkaPartitionConsumerApplication {
public static void main(String[] args) {
new SpringApplicationBuilder(KafkaPartitionConsumerApplication.class)
.web(false)
.web(WebApplicationType.NONE)
.run(args);
}
@Bean
public Consumer<Message<String>> listen() {
return message -> {
int partition =- message.getHeaders().get(KafkaHeaders.RECEIVED_PARTITION_ID);
System.out.println(in + " received from partition " + partition);
int partition = (int) message.getHeaders().get(KafkaHeaders.RECEIVED_PARTITION);
System.out.println(message + " received from partition " + partition);
};
}