
Originally Posted by
skilledmonster
Personally, I would recommend [Approach 2]. This way you don't have to worry about rollback. Also, once the message is fetched from the queue, rollback doesn't put it back into the queue unless you have a special logic. It also depends if sequencing is important, in which case [Approach 1] will probably not work.
I would do something like -
1 - Poll the remote directory.
2 - If the file is consumed / processed / deleted, fetch the message from the JMS
3 - Add header information and drop it via FTP