views:

217

answers:

3

My customer sometimes receives "spam" messages on their BizTalk file drop locations i.e files not of the type expected by the receive location filter eg a .doc instead of a .xls. The file adaptor does not have an option to delete such "junk" - probably for good reason- , and we can not stop the sender of these files from occasionally sending them.

My solution would be to use a scheduled task to periodically run a powershell script which moves all the files which do not match the receive location filter to a folder, where a user can check the files, and delete any "spam" thus preventing the folders from eventually filling up.

Is there a better way to achieve this ?

A: 

To be honest, you've pretty much already came up with the simplest solution :) There's nothing on BizTalk that would really help you avoid this issue, so any other options would involve adding custom code for it.

For example, you could set up the receive location to pick of files (.) and then have a custom pipeline component that discards unwanted messages.

tomasr
A: 

Thanks tomasr.

If "files" is the biztalk drop folder and "spam" is the folder for spam files, then this line of PowerShell moves all the non csv files from "files" folder to the "spam" folder.

dir -path files -exclude *.csv | move-item -dest spam

This is then run by saving to a powershell script and running via the windows system task scheduler.

A: 

Alternatively you could have the Receive location look for all files and remove the suspended messages that BizTalk couldn't process. Presumably someone is monitoring the admin console anyhow.

yieldvs