I am using an bpmn process which is already running using thread and also using spring ftp where the Task scheduler thread is running but I found the application is cannot switch from the threads. Is there any way to invoke the task-scheduler process without any interrupt and I am using InboundchannelAdapter to copy files from FTP. Please suggest any feasible way to resolve the issue.
1 Answers
I don't see any issues in your question. And to be honest it fully isn't clear.
Please, be more specific and sharing some code/config/logs/stack-trace sometime is really useful. More info, more chance to get quick and proper answer.
I guess your problem that you download files from FTP and in the same thread run a BPM process which might block eventually waiting for some actor action.
Fro this purpose you should shift Spring Integration flow on the <poller>
to different thread and don't steal task-scheduler resources. They are really so expensive for the whole system. Consider to use enough big ThreadPoolTaskExecutor
for the task-executor
reference on the <poller>
. Also there is an ExecutorChannel
for you with similar thread shifting capabilities.

- 113,505
- 11
- 91
- 118
-
Thanks Artem,But the problem,as of now is the Thread from FTP (Task-scheduler) is running properly after copying files from FTP for sometime and it will invoke BPM process. The bpm process is running continuously and it is using [http-nio-8082-exec-3] thread and it ranges as similar to ftp(1-10 thread).Where FTP process is using this [task-scheduler-3](1-10), after sometime FTP process skipping the BPM process stage,sometime instead of starting from 1st step it is going to 3rd step. I am really worried on this.please advise, Is there way to avoid the task-scheduler thread process skipping. – user3428736 Jun 20 '16 at 12:06
-
Well, that just does not make any sense and you should revise your logic around there. You might have some race condition which leads you to the wrong branch. On the other hand the `http-nio-8082-exec-3` says me that it relates to some user request from the Web, meanwhile poller's process (FTP Inbound Channel Adapter) is independent and work forever. That is how you may just not have BPM process when files appear from FTP locally. – Artem Bilan Jun 20 '16 at 13:08
-
This is happening some times and working with task-schedular thread task to process bpmn process and moreover this is issue seems to be problem with the bpmn process where the logic of bpmn is a direct call to start the process using startProcessInstanceByKey and i don't have any control over the bpmn code where the process will start automatically and there is an unidentified trace over there. I guess it is not because of task-scheduler. If you have any idea on this please share.. Thanks Artem!! – user3428736 Jun 20 '16 at 13:30
-
Yeah... Sorry, that is already out of my knowledges. Maybe you can somehow make that `startProcessInstanceByKey` to do its job in the separate thread not the BPM's started one... – Artem Bilan Jun 20 '16 at 13:34