Skip to content

Fix DSL for inner bean names generation #8639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ private void processIntegrationComponentSpec(String beanName, IntegrationCompone
.filter(component -> noBeanPresentForComponent(component.getKey(), beanName))
.forEach(component ->
registerComponent(component.getKey(),
generateBeanName(component.getKey(), component.getValue())));
generateBeanName(component.getKey(), beanName, component.getValue(), false)));

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,10 @@ void testGateways() throws Exception {
}

@Test
void channels(@Autowired MessageChannel topic6Channel, @Autowired PollableKafkaChannel topic8Channel,
@Autowired PollableKafkaChannel topic9Channel) {
void channels(@Qualifier("topic6Channel") MessageChannel topic6Channel,
@Qualifier("topic8Channel") PollableKafkaChannel topic8Channel,
@Qualifier("topic9Channel") PollableKafkaChannel topic9Channel) {

topic6Channel.send(new GenericMessage<>("foo"));
Message<?> received = topic8Channel.receive();
assertThat(received)
Expand Down Expand Up @@ -344,7 +346,8 @@ public PollableChannel futuresChannel() {
}

@Bean
public IntegrationFlow sendToKafkaFlow() {
public IntegrationFlow sendToKafkaFlow(
KafkaProducerMessageHandlerSpec<Integer, String, ?> kafkaMessageHandlerTopic2) {
return f -> f
.<String>split(p -> Stream.generate(() -> p).limit(101).iterator(), null)
.enrichHeaders(h -> h.header(KafkaIntegrationHeaders.FUTURE_TOKEN, "foo"))
Expand All @@ -353,17 +356,15 @@ public IntegrationFlow sendToKafkaFlow() {
kafkaMessageHandler(producerFactory(), TEST_TOPIC1)
.timestampExpression("T(Long).valueOf('1487694048633')"),
e -> e.id("kafkaProducer1")))
.subscribe(sf -> sf.handle(
kafkaMessageHandler(producerFactory(), TEST_TOPIC2)
.flush(msg -> true)
.timestamp(m -> 1487694048644L),
e -> e.id("kafkaProducer2")))
.subscribe(sf -> sf.handle(kafkaMessageHandlerTopic2, e -> e.id("kafkaProducer2")))
);
}

@Bean
public DefaultKafkaHeaderMapper mapper() {
return new DefaultKafkaHeaderMapper();
public KafkaProducerMessageHandlerSpec<Integer, String, ?> kafkaMessageHandlerTopic2() {
return kafkaMessageHandler(producerFactory(), TEST_TOPIC2)
.flush(msg -> true)
.timestamp(m -> 1487694048644L);
}

private KafkaProducerMessageHandlerSpec<Integer, String, ?> kafkaMessageHandler(
Expand All @@ -382,6 +383,11 @@ public DefaultKafkaHeaderMapper mapper() {
.configureKafkaTemplate(t -> t.id("kafkaTemplate:" + topic));
}

@Bean
public DefaultKafkaHeaderMapper mapper() {
return new DefaultKafkaHeaderMapper();
}


@Bean
public IntegrationFlow sourceFlow() {
Expand Down Expand Up @@ -427,7 +433,7 @@ public KafkaMessageSource<Integer, String> channelSource(ConsumerFactory<Integer
@Bean
public IntegrationFlow channels(KafkaTemplate<Integer, String> template,
ConcurrentKafkaListenerContainerFactory<Integer, String> containerFactory,
KafkaMessageSource<?, ?> channelSource,
@Qualifier("channelSource") KafkaMessageSource<?, ?> channelSource,
PublishSubscribeKafkaChannel publishSubscribeKafkaChannel) {

return IntegrationFlow.from(topic6Channel(template, containerFactory))
Expand Down