Reputation: 3774
I have a Spring Integration context with multiple inbound channel adapters, each with his own poller (currently all the pollers have their refresh time configured with fixed-delay but may use fixed-rate in future). All the inbound adapters output their produced messages to the same processing chain. The question is what is the behaviour of polling and message consuming in such a situation? Imagine, that poller #1 has produced 1000 messages and they are handed to my processing chain. Since processing can take some significant time it is possible that it has come time for the poller #2 to do its job and possibly produce messages. But remeber - my processing chain is still handling messages passed by poller #1. What happens?
Note that all my channels are direct channels and there are no task executors used.
Upvotes: 3
Views: 1159
Reputation: 109
I have almost the same case, however the behaviour is a bit differs.
My case is :
And now i see at logs that each thread executes all pollers sequently, and if there is an empty queue (i am using blocking queue) then all threads are delayed for 1 sec. This means even if you have enough threads you still may get delay for all your threads if at least one poller is slow. For instance if I would not use timeout for queue reading at all then all threads would stop on empty queue and nothing would be read from all others non-empty queues .
To solve this issue I guess we need to configure separate thread pools for each poller<-->inbound channel adapter.
Upvotes: 0
Reputation: 174484
Pollers are independent tasks handled by the common taskScheduler
bean; as long as the task scheduler has sufficient threads, there is no coordination across pollers.
If the pool is exhausted, pollers will run "late".
By default the taskScheduler
has 10 threads; but you can reconfigure it.
Upvotes: 2