I am working on an existing Spring Integration code that is getting stuck.
Below code is getting struck. Around 20,000 records are fetched from the sql query and sent to splitter.
code:
<int-jdbc:outbound-gateway query="..." />
<int:splitter input-channel="..." output-channel="queueChannel"/>
<int:channel id="queueChannel">
<int:queue capacity="25" />
</int:channel>
<int:service-activator ref="..."
input-channel="queueChannel" output-channel="..." method="xxx">
<int:poller max-messages-per-poll="25" fixed-delay="100"
receive-timeout="30000" task-executor="reqExecutor"/>
</int:service-activator>
<task:executor id="reqExecutor" pool-size="25" queue-capacity="5" rejection-policy="CALLER_RUNS" />
After doing some search on the internet, here is my understanding of the code. Please correct me, If I am wrong:
splitter output channel is queue channel with capacity of 25 that means it will fetch batch of 25 records from the query.
Now, the code written in service activator will be polled every 100 ms and fetch 25 messages from the queue channel. Service Activator runs in multi-threaded environment with task executor.
Task executor has a pool size of 25. Thats the max number of threads that can run at a time. and the queue-capacity of 5. If all threads are busy then Executor will put them in queue. If queue capacity is reached to 5 then executor will reject the task.
The rejection policy is CALLER_RUNS. The Executor will use the main process on rejection.
Application Performance may get affected by CALLER_RUNS rejection policy. But other policies discard or abort the thread. So, changing rejection policy is not a solution.
Shall I change pool-size or queue-capacity of the task executor to resolve the issue. Is there any preferred value. What shall be the impact of it.
Or, Shall I change the fixed-delay of poller?
EDIT 1:
In the logs, below line is repeatedly coming and the process is not finishing:
Received no Message during the poll, returning 'false'
EDIT 2:
Is my issue related to issue mentioned in the link below:
Also, I don't clearly understand the receive-timeout attribute of poller.