GH-1776 Added support for beanName to DirectWithAttributesChannel
Resolves #1776
This commit is contained in:
@@ -37,4 +37,8 @@ public class DirectWithAttributesChannel extends DirectChannel {
|
||||
return this.attributes.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBeanName() {
|
||||
return this.getComponentName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,28 +252,13 @@ public class SourceToFunctionsSupportTests {
|
||||
public static class ExistingMessageSourceConfiguration {
|
||||
|
||||
@Bean
|
||||
public IntegrationFlow messageSourceFlow() {
|
||||
public IntegrationFlow messageSourceFlow(Source source) {
|
||||
Supplier<Message<String>> messageSource = () -> MessageBuilder
|
||||
.withPayload("hello function")
|
||||
.setHeader(MessageHeaders.CONTENT_TYPE, MimeTypeUtils.TEXT_PLAIN)
|
||||
.build();
|
||||
return IntegrationFlows.from(messageSource).channel("output").get();
|
||||
return IntegrationFlows.from(messageSource).channel(source.output()).get();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EnableBinding(Source.class)
|
||||
public static class ExistingMessageSourceConfigurationNoContentTypeSet {
|
||||
|
||||
@Bean
|
||||
public IntegrationFlow messageSourceFlow() {
|
||||
Supplier<Message<String>> messageSource = () -> MessageBuilder
|
||||
.withPayload("hello function")
|
||||
.setHeader(MessageHeaders.CONTENT_TYPE, "application/octet-stream")
|
||||
.build();
|
||||
return IntegrationFlows.from(messageSource).channel("output").get();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user