Home > BizTalk Server > BizTalk Archiving – SQL and File Documentation

BizTalk Archiving – SQL and File Documentation


I moved the documentation from: http://biztalkarchiving.codeplex.com/documentation, since it’s unreadable on the site.
 

BizTalk Archiving SQL and File Documentation

 

Installation

  1. Run MSI installer
  2. Install it on <Program Files>\BizTalk Server 2010\PipelineComponents.
  3. Go to <Program Files>\BizTalk Server 2010\PipelineComponents\BizTalkMsgArchiveScripts folder, execute RegisterSource.cmd (As administrator), this will register the source so that the pipeline can log to the event log.

Usage – Design Time – VS2010

  1. Open VS2010 -> Create new BizTalk Project -> Add Receive Pipeline
  2. Right Click ToolBox -> Choose Items
  3. Go to BizTalk Pipeline Components -> Check BizTalk Message Archiving Component
  4. New Pipepline Added to the toolbox.
  5. Drag & Drop the BizTalk Message Archiving Component to Decode Stage.
  6. Configure Properties (see Configuration)

Note: You can also configure the Properties using BizTalk Administration Console.

Setup – SQL Archiving

Since the archiving will use an SQL Database, you’ll need to create the database and table.

  1. Go to <Program Files>\BizTalk Server 2010\PipelineComponents\BizTalkMsgArchiveScripts folder.
  2. Execute the CreateDatabase.sql on the target database server. This will create the database named: BizTalkArchiveDb, table named: Messages and stored procedure named: InsMessages

Configuration

  1. Deploy the pipeline that uses the BizTalk Message Archiving Component (See Usage – Design Time – VS2010)
  2. Using BizTalk Administration Console, create a new Receive Location and use the pipeline on previous number, on the pipeline click the Elipsis .. to display properties.
Property Name Description Use In Sample Values Notes
CompressionPassword Password that will be used in zip file File & SQL Archiving P@ssw0rd
DbConnProvider Connection Provider SQL Archiving System.Data.SqlClient
DbConnStr Database connection string SQL Archiving Data Source=localhost;Initial Catalog=BizTalkArchiveDb;Integrated Security=SSPI; Using integrated security you need to grant the identity of the host wherein the receive/send port is binded permission to BizTalkArchiveDb with ff roles: dbdatareaderdatawriter, db and execute permission on the stored procedure InsMessages
DbFileExtensions File extension to be used SQL Archiving .xml
DbPropList This is a set of delimited values of name & namespace of message context properties that will be passed to the stored procedure to be used for custom logging. SQL Archiving ReceivedFileName;http://schemas.microsoft.com/BizTalk/2003/file-properties|ReceivedPortName;http://schemas.microsoft.com/BizTalk/2003/system-properties Format is Property Name;Namespace and for multiple values the delimiter is ‘|’ pipe symbol.
DbSPName Stored procedure name SQL Archiving Built-In: InsMessages The stored procedure can be customized as long as it has the same signature with the default one. For instance, there can be additional logic to parse the Message Properties and insert it into the new custom table
FileArchiveBackFolder Folder / Shared Location / Network location wherein the files will be archived File Archiving \\RPaulo2011\Test\Archive If it’s a shared folder the pipeline will try to use first the identity of the host, if it failed it will use the credentials supplied (see FileArchive UserName, Password, Domain)
FileArchiveFileName Name of the archive file File Archiving %SourceFileName%_%datetime% Supported macros are: – %SourceFileName%, %MessageID%,%datetime%, %time%
FileArchiveIsOverwriteFiles Overwrite Flag File Archiving True
FileArchiveUserDomain Domain name of user credentials File Archiving PAULOR This values will be used if the identity of the host instance doesn’t have permission on the backup folder.
FileArchiveUserName User name File Archiving BizTalkUser This values will be used if the identity of the host instance doesn’t have permission on the backup folder.
FileArchiveUserPwd Password File Archiving P@ssword This values will be used if the identity of the host instance doesn’t have permission on the backup folder.
IsArchiveToDb Archive to database flag SQL Archiving True True = Archive to database, False = Disabled
IsArchiveToFile Archive to file flag File Archiving True True = Archive to file, False = Disabled
IsCompressFile compress file flag SQL & File Archiving True True = Compress the file, False = No compression, It uses DotNetZip

Usage – Downloading Archive Files using ASP.NET

https://randypaulo.wordpress.com/2011/06/21/storing-files-to-database-and-downloading-using-asp-net/

Advertisements
  1. M.Papas
    July 18, 2012 at 12:28 pm

    Hi Randy!

    Thanks for a great pipeline component and a great blog.

    Will this pipeline component work with WCF-SAP adapter? I have tried it, but I’m getting the following error:

    “System.ArgumentException: The path is not of a legal form.
    at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
    at System.IO.Path.GetFullPathInternal(String path)
    at System.IO.FileInfo..ctor(String fileName)
    at BizTalk.Archiving.PipelineComponents.ArchiveComponent.ArchiveToFile(IMessageArchiveProvider provider, Guid msgId, IBaseMessageContext context, Stream msgStream)
    at BizTalk.Archiving.PipelineComponents.ArchiveComponent.Execute(IPipelineContext pContext, IBaseMessage inMsg)’

    the message resource is present but the message is not found in the string/message table”

    I’m setting the following parameters:
    FileArchiveBackupFolder = “\\Biztalk-d-01\Archive”
    FileArchiveFileName = %SourceFileName%_%datetime%
    FileArchiveIsOverwriteFiles = False
    IsArchiveToFile = True

  2. July 19, 2012 at 5:32 pm

    Hi,

    Since WCF-SAP adapter doesn’t have SourceFileName try using %MessageID%_%datetime% instead.

  3. October 10, 2013 at 10:02 am

    Hi Randy

    This is very helpful so thanks in advance.

    I notice that in the ArchiveToDb method the “destination” variable is set to null and only allocated another value if the IsCompressFile has been set to true. I don’t need compression and so the the component goes on to throw a null value exception.

    Am I missing something?

    Thanks,

    Rob.

    • October 10, 2013 at 11:24 am

      My comment was based on me Reflecting the assembly installed with the MSI. Once I downloaded the source code, built and re-deployed the component worked great so thanks again!

  4. Kiran
    August 21, 2015 at 11:54 am

    Hi Randy,
    I am currently using a CForwardOnlyEventingReadStream to archive files and it has limitations as explained in
    https://andreikos.wordpress.com/2012/06/22/using-cforwardonlyeventingreadstream-for-message-archving/comment-page-1/
    I wanted to find out if your archive component uses the same mechanism and has a similar limitation?
    Thanks,
    Kiran

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: