You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
436 B
26 lines
436 B
package org.test |
|
|
|
@Component |
|
@EnableIntegrationPatterns |
|
class SpringIntegrationExample implements CommandLineRunner { |
|
|
|
@Bean |
|
DirectChannel input() { |
|
new DirectChannel(); |
|
} |
|
|
|
@Override |
|
void run(String... args) { |
|
print new MessagingTemplate(input()).convertSendAndReceive("World") |
|
} |
|
} |
|
|
|
@MessageEndpoint |
|
class HelloTransformer { |
|
|
|
@Transformer(inputChannel="input") |
|
String transform(String payload) { |
|
"Hello, ${payload}" |
|
} |
|
|
|
}
|
|
|