I've created a Gateway and a polling notificationChannel which the Gateway uses to route messages. I want a service activator to poll from the channel and do its thing. But I can't seem to grasp a few things about Spring Integration.
In this case would we need an IntegrationFlow Bean? Wouldn't calling the gateway method just send the message trough the channel and the service activator can just poll automatically when there is a new message?
ConfigurationClass:
@EnableIntegration
@Configuration
@IntegrationComponentScan
class IntegrationConfiguration {
@Bean
fun notificationChannel(): MessageChannel {
return MessageChannels.queue().get()
}
@Bean
fun integrationFlow(): IntegrationFlow {
TODO()
}
}
Gateway:
@MessagingGateway(defaultRequestChannel = "notificationChannel")
@Component
interface NotificationGateway {
fun sendNotification(bytes: ByteArray)
}
Service:
@Service
class NotificationService {
@ServiceActivator(inputChannel = "notificationChannel")
fun sendNotification(bytes: ByteArray) {
TODO()
}
}
I am new to Spring Integration and having a rough time since I can't find understandable documentation for my level of knowledge especially on Spring Integration DSL.
My main problem might be that I do now understand the use of the IntegrationFlow Bean