@@ -21,7 +21,6 @@ import org.springframework.context.annotation.Configuration
2121import org.springframework.integration.channel.DirectChannel
2222import org.springframework.integration.channel.QueueChannel
2323import org.springframework.integration.config.EnableIntegration
24- import org.springframework.integration.dsl.IntegrationFlow
2524import org.springframework.integration.dsl.integrationFlow
2625import org.springframework.messaging.MessageChannel
2726
@@ -30,24 +29,57 @@ import org.springframework.messaging.MessageChannel
3029 *
3130 * @author Glenn Renfro
3231 */
33- @Configuration
32+ @Configuration(proxyBeanMethods = false )
3433@EnableIntegration
3534open class HelloWorldConfig {
3635
36+ /* *
37+ * Creates the input channel for inbound messages.
38+ *
39+ * A [DirectChannel] is used for synchronous, immediate message delivery.
40+ * Messages arriving on this channel are processed on the sender's thread
41+ * without any buffering or queuing.
42+ *
43+ * @return A [DirectChannel] instance for synchronous inbound message delivery
44+ */
3745 @Bean
3846 open fun inputChannel () = DirectChannel ()
3947
48+ /* *
49+ * Creates the output channel for outbound messages.
50+ *
51+ * A [QueueChannel] with capacity of 10 messages provides asynchronous,
52+ * buffered message delivery. Results from the integration flow are queued
53+ * and available for downstream consumption.
54+ *
55+ * @return A [QueueChannel] instance with capacity of 10 messages
56+ */
4057 @Bean
4158 open fun outputChannel () = QueueChannel (10 )
4259
60+ /* *
61+ * Creates the Hello World business service.
62+ *
63+ * [HelloService] implements the core greeting logic that transforms
64+ * input messages into personalized greeting responses.
65+ *
66+ * @return A [HelloService] instance
67+ */
4368 @Bean
4469 open fun helloService () = HelloService ()
4570
71+ /* *
72+ * Defines the main integration flow for message processing.
73+ *
74+ * @param inputChannel The synchronous input channel receiving messages
75+ * @param outputChannel The asynchronous output channel for results
76+ * @param helloService The service implementing the greeting logic
77+ * @return An IntegrationFlow representing the complete message flow
78+ */
4679 @Bean
47- open fun helloWorldFlow (inputChannel : MessageChannel ,
48- outputChannel : MessageChannel ) = integrationFlow(inputChannel) {
49- handle(helloService() , " sayHello" )
80+ open fun helloWorldFlow (inputChannel : MessageChannel , outputChannel : MessageChannel , helloService : HelloService ) =
81+ integrationFlow(inputChannel) {
82+ handle(helloService, " sayHello" )
5083 channel(outputChannel)
5184 }
52-
5385}
0 commit comments