File consumer gotchas with CAPS

In my day job I get the pleasure of working with $$$ ESB platforms from large vendors such as SUN and IBM. Mostly SUN but I get the deployer role from time to time on the IBM platform.

Well this time I had some trouble implementing a file based resend feature. The idea is to drop the backup file in a certain folder and then CAPS will pickup the file and resend it as if it was the original request (webservice).

While working on this one I got side tracked as CAPS once in a while would drop this error in the log:
kupFiles2CAPS|_ThreadID=149; ThreadName=Worker: 74;|[mammatus.rh.dk] [3180_10_BACKUPFILES2CAPS] [] [ERROR] [9] [] [3180_10_BACKUPFILES2CAPS] [CAPS]
[Batch Local File eWay error when doing file operation in [get()], message=[LocalFileClientImpl.get: Failed to get file to the payload.Nested exce
ption follows: ---
com.stc.eways.common.eway.standalone.streaming.StreamingException: LocalFileClientImpl.requestInputStream: Exception occurred.Nested exception foll
ows: ---
com.stc.eways.batchext.BatchException: Unable to find a file matching the Target Location configuration settings.Nested exception follows: ---
java.io.FileNotFoundException: Directory Name: /caps/projectdata/3180_EUP/resend/ File name: 8C803FD4-C7D8-A2BF-BA0B-5BF045012BA7.20081022-12145726
4-87-eup.xml--- End of nested exception.
--- End of nested exception.
--- End of nested exception.
].Nested exception follows: ---
After a while I realized it's the fact that CAPS will rename in progress files with a GUI prefix but keeping the original filename as postfix.

Original name: 20081022-121457264-87-eup.xml
In progress filename: 8C803FD4-C7D8-A2BF-BA0B-5BF045012BA7.20081022-12145726

So what is the problem here? Well the fact is that I have setup CAPS to monitor this folder and consume .xml files. So what CAPS will do is to also consume it's in progress file ;)

I haven't found a setting where I can change this to eg. let CAPS use a sub folder or a different file extension for in progress files.

Now I gotta change the regexp for matching the files to a avoid the CAPS in progress files.

No comments: