Tallan's Technology Blog

Tallan's Top Technologists Share Their Thoughts on Today's Technology Challenges

BizTalk File Backup

Stan Kennedy

Business or system constraints may force you to leverage BizTalk for File backups.  BizTalk can actually handle this pretty well if it’s planned out carefully.

Here is a diagram of the overall design:

One way to implement this is to set up a receive port and location to poll the original drop location of the files.  This receive location will be set up as PassThruReceive where no disassembling of the message will occur (actually there are no pipeline components for PassThru).

Receive Port

General

Name

FileReceive

Receive Locations

New (see below table)

Receive Location

General

Name

FileReceive.FTP

Type

FTP

Configure FTP (note this can be any adapter type)

Receive Handler

BizTalkServerApplication

Receive Pipeline

PassThruReceive

Next, create two new Send PassThru ports that subscribes to that receive port using Filters.  The first Send port will send the message to a backup folder.  The second port sends the message to a new file receive location that will be polled for incoming messages for processing.

Use the follow configurations for the Send PassThru for backup files.  Use the macro %datetime% and %SourceFileName% for the backup directory file names.  The %SourceFileName% retains the original file name including the extension.  Remember that macros are case sensitive.

Send Port

General

Name

BackupFileCopySend

Type

File

Configure file location to backup directory

File name = %datetime%_%SourceFileName%

Send Handler

BizTalkServerSend

Send Pipeline

PassThruTransmit

Filters

Property ‘BTS.ReceivePortName’

Operator ‘==’

Value ‘FileReceive’

The second send port will send the file to the new file drop location.  Your receive ports for processing will poll this new location.  Use only %SourceFileName% macro to cary over the original file name.

Send Port

General

Name

FileInSend

Type

File

Configure file location to new file drop directory.

File name = %SourceFileName%

Send Handler

BizTalkServerSend

Send Pipeline

PassThruTransmit

Filters

Property ‘BTS.ReceivePortName’

Operator ‘==’

Value ‘FileReceive’

Set both of these ports up by changing the Send pipeline to PassThruTransmit.  Messages that are processed via BizTalk have context properties even though it’s PassThru.  Use one of the context properties in in the Filter property: BTS.ReceivePortName == ‘FileReceive’ (name should match rcv port above).  Now, every message that arrives from our receive port will be copied to the backup file directory and the new incoming file drop directory.

The last step is to set up a receive port that polls the new file drop location.

3 Comments. Leave new

Can you please tell why you need Backup Transport of Send Port? If the Backup files is performed you specified manner.

Referenced, appreciated, thanks!

Very well used… Appreciate for sharing..really helped …thanks a lot !

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

\\\