|
46 | 46 | import org.springframework.kafka.KafkaException.Level;
|
47 | 47 | import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
|
48 | 48 | import org.springframework.kafka.config.KafkaListenerContainerFactory;
|
| 49 | +import org.springframework.kafka.config.KafkaListenerEndpointRegistry; |
49 | 50 | import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
|
50 | 51 | import org.springframework.kafka.core.DefaultKafkaProducerFactory;
|
51 | 52 | import org.springframework.kafka.core.KafkaAdmin;
|
@@ -97,7 +98,8 @@ public class BatchListenerConversionTests {
|
97 | 98 | private KafkaTemplate<Integer, Object> template;
|
98 | 99 |
|
99 | 100 | @Test
|
100 |
| - public void testBatchOfPojos() throws Exception { |
| 101 | + public void testBatchOfPojos(@Autowired KafkaListenerEndpointRegistry registry) throws Exception { |
| 102 | + assertThat(registry.getListenerContainerIds()).contains("blc1.id", "blc2.id"); |
101 | 103 | doTest(this.listener1, "blc1");
|
102 | 104 | doTest(this.listener2, "blc2");
|
103 | 105 | }
|
@@ -273,7 +275,8 @@ public KafkaListenerContainerFactory<?> getContainerFactory() {
|
273 | 275 | return this.cf;
|
274 | 276 | }
|
275 | 277 |
|
276 |
| - @KafkaListener(topics = "#{__listener.topic}", groupId = "#{__listener.topic}.group", |
| 278 | + @KafkaListener(id = "#{__listener.topic}.id", topics = "#{__listener.topic}", |
| 279 | + groupId = "#{__listener.topic}.group", |
277 | 280 | containerFactory = "#{__listener.containerFactory}")
|
278 | 281 | // @SendTo("foo") test WARN log for void return
|
279 | 282 | public void listen1(List<Foo> foos, @Header(KafkaHeaders.RECEIVED_TOPIC) List<String> topics,
|
|
0 commit comments