Polly: The fallback position

Parrot flying with Eagles

How many times in an application dependent on some external resource do you have to write a function or a maybe a whole module to deal with fallback cases? Perhaps the web service you call is down and you fallback to data cached from the last call, or a ftp site is not available so you send the third-party an automatic email to notify them. As developers we are constantly coding fallbacks.

Last week I gave a brief introduction to Polly a fault handling library built for .Net Standard and .Net Core. We looked at the wait and retry functionality that the library has, which would be useful if the external resource is having a blip, but what about if it is down, how do we gracefully degrade?

Continue reading →

Upload files to FTP using the WINSCP .Net library


Applications like Filezilla and WinSCP are great simple to use FTP/SFTP clients. However what about if you want to automate uploading files. Imagine you have a brilliant SSIS package, that extracts, manipulates and formats just the right data into the correct format, using SQL Server agent to run  your package early in the morning to take advantage of the gap in transactions hitting the database server. You want these extracted data files to be sent to a third party without you needing to log in open WINSCP  or Filezilla and manually upload them.

That is what we are going to look at today, a few simple methods for zipping some files and uploading them in an application that can then be set to run on a schedule with something like Windows Task Scheduler.

Continue reading →