File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
spring-kafka-docs/src/main/antora/modules/ROOT/pages
spring-kafka/src/main/java/org/springframework/kafka/annotation Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ The following is an example of how to use the power of a SpEL expression to crea
12
12
[source, java]
13
13
----
14
14
@KafkaListener(topicPartitions = @TopicPartition(topic = "compacted",
15
- partitions = "#{@finder.partitions('compacted')}") ,
15
+ partitions = "#{@finder.partitions('compacted')}",
16
16
partitionOffsets = @PartitionOffset(partition = "*", initialOffset = "0")))
17
- public void listen(@Header(KafkaHeaders.RECEIVED_MESSAGE_KEY ) String key, String payload) {
17
+ public void listen(@Header(KafkaHeaders.RECEIVED_KEY ) String key, String payload) {
18
18
...
19
19
}
20
20
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2016-2019 the original author or authors.
2
+ * Copyright 2016-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
27
27
/**
28
28
* Enable Kafka listener annotated endpoints that are created under the covers by a
29
29
* {@link org.springframework.kafka.config.AbstractKafkaListenerContainerFactory
30
- * AbstractListenerContainerFactory }. To be used on
30
+ * AbstractKafkaListenerContainerFactory }. To be used on
31
31
* {@link org.springframework.context.annotation.Configuration Configuration} classes as
32
32
* follows:
33
33
*
117
117
*
118
118
* <pre class="code">
119
119
* @KafkaListener(containerFactory = "myKafkaListenerContainerFactory", topics = "myTopic")
120
- * public void process(String msg, @Header("kafka_partition" ) int partition) {
120
+ * public void process(String msg, @Header(KafkaHeaders.RECEIVED_PARTITION ) int partition) {
121
121
* // process incoming message
122
122
* }
123
123
* </pre>
174
174
* @Override
175
175
* public void configureKafkaListeners(KafkaListenerEndpointRegistrar registrar) {
176
176
* registrar.setEndpointRegistry(myKafkaListenerEndpointRegistry());
177
- * registrar.setMessageHandlerMethodFactory(myMessageHandlerMethodFactory);
177
+ * registrar.setMessageHandlerMethodFactory(myMessageHandlerMethodFactory() );
178
178
* registrar.setValidator(new MyValidator());
179
179
* }
180
180
*
233
233
* @author Stephane Nicoll
234
234
* @author Gary Russell
235
235
* @author Artem Bilan
236
+ * @author Borahm Lee
236
237
*
237
238
* @see KafkaListener
238
239
* @see KafkaListenerAnnotationBeanPostProcessor
You can’t perform that action at this time.
0 commit comments