Suspended Message Routing and Error Reporting

This sample shows how to use Error Reporting to route suspended message to an Orchestration in Biztalk 2006. It includes two Orchestrations, one intended to fail on the Receive Port and one on the Send Port. Both a manual installation and MSI installation is available.

Get more information from the original blog post on this topic:http://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalk/archive/2005/08/02/suspended-message-routing-and-reporting-in-biztalk-server-2006.aspx

Suspended Message Routing and Reporting in Biztalk Server 2006

Suspended message routing is arguably the greatest and most anticipated new feature in Biztalk 2006. 


Suspended message routing gives you the ability to subscribe to messages that fail inside the messaging system.  Matt Hall going into detail on how to generate Error Reports for Suspended Message Routing and what properties you have available to subscribe to.  In addition, the documentation that ships with Beta 1 cover this is great detail.


The ability to react to errors in the messaging system goes much deeper then just “No Matching Subscription” errors.  You now have the ability to easily handle all messaging errors that occur inside a pipeline, an adapter, and even maps.  That’s right, no more looking into the great abyss for Send and Receive Port mapping errors.


In a post about a year ago, I point out that Delivery Notification in Biztalk 2004 did not work when the map fails on the Send Port.  Not any more!  Now, Delivery Notification supports Send Port mapping exceptions as well as adapter exceptions.


That brings up another point.  You now have Error Reporting, native support for First-in First-out on EVERY Send Adapter, and the traditional Delivery Notification to accomplish FIFO in Biztalk 2006.  With all these options available it could be very easy to go overboard and needlessly bog down a process with too many bells and whistles.  Off hand, I can not see a need in using both Delivery Notification and FIFO on a Send Adapter together in a single process.


I have put together a small sample that works with Error Reporting and Suspended Message Routing.  It includes two Orchestrations, one intended to fail on the Receive Port and one on the Send Port.  In addition, I have included a map that throws an Exception.  In the suspended message routing Orchestration, I subscribe to the ErrorReport.FailureCode exists property. 


Download: Biztalk 2006 Suspended Message Routing Sample


The download includes a binding file with source code as well as a packaged MSI.  This should only be run on Biztalk 2006.

How To Prepend to the SourceFileName in BizTalk Sample

Biztalk 2004 provides a variety of built in macros for dynamically naming files.  A full list of macros can be found in the help guide or here. 



Recently, I have been looking at SourceFileName.  I have posted a sample in the past that covers how to name output files inside your Orchestration using the %SourceFileName% macro.  In that sample, I completely override the File.ReceivedFileName property with a new value.  The File.ReceivedFileName property is the data source for the %SourceFileName% macro.



What if I wanted to append or prepend data to the original file name?  When using the File Receive Adapter, the File.ReceivedFileName property looks like this: “c:\somepath\FileName.xml”. 



If you prepend or appended text to this, you will get “PrePend_c:\somepath\FileName.xml” or “c:\somepath\FileName.xml_Append”. 



When the %SourceFileName% macro runs, it looks for the last “\” and truncates the beginning part of the filename.  So, in the Prepend case, the prepended text is completely lost.



How can I prepend or append text to the filename?  Easy, just use a simple static helper class to prep the filename.  The method to prepend text would look like this:



public static string PrePendText(string sReceivedFileName, string sPreppendText)


{


 int nLastIndex = sReceivedFileName.LastIndexOf(@”\”);


 return sPreppendText + sReceivedFileName.Substring(nLastIndex+1);


}



I have put together a sample with three methods; one to prepend text, one to append text, and one to append text and change the file extension. 



Download: Prepend and Append Text to Filename Sample



Setup is easy.  Just deploy the Orchestration and do not forget to GAC the Helper class.

Prepend and Append Text to SourceFileName Macro

This sample shows how use the %SourceFileName% macro to append or prepend text to the original file name of the file received by the file adapter. This sample includes a helper class with three methods to help with string manipulation of the file name.

This uses an Orchestration to set the Received File Name Message Context Property that the SourceFileName Macro uses. 

This sample will work for BizTalk 2004 and BizTalk 2006.

Get more information from the original blog post on this topic:http://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalk/archive/2005/08/01/how-to-prepend-to-the-sourcefilename-in-biztalk-sample.aspx

BizTalk Server 2006 Beta Program

 Biztalk 2006 Beta is now available for public sign up. 

 Biztalk Server 2006 greatly simplifies the administration and deployment process.  Some of the other key enhancements are the flat file schema wizard, calling pipeline from an Orchestration, improved BAM, and suspended message routing, just to name a few.

 To sign up for the beta program follow these easy steps:

 1.  Go to http://beta.microsoft.com

 2.  Sign in with your passport

 3.  At the top of the page it should say something like “if you have a Guest Id click here”. 

 4.  Enter: BizTalkBetaTeam (case sensitive) as your guest id.

 5.  Fill out the survey.  I think the link is located on the left side of the screen.  Make sure you do not use a PO Box.

 6.  You should get a welcome email once you are processed.  I do not know how long this will take.  

I recommend anyone interested in Biztalk to take advantage to this beta program.  It will give you a great opportunity to see the new features of the upcoming release and to have access to the beta news group.  Just a note, Visual Studios 2005 Beta 2 is also required.

 Once you have the software installed, do not forget to check out www.BizTalkGurus.com for samples and videos covering the new features of Biztalk 2006.

Have fun !!!

Updated Version of Biztalk 2004 Pipeline Component Wizard Available

Martijn has made some excellent updates to his
pipeline component wizard for Biztalk 2004. 

This visual studio
wizard is a must have for anyone trying to write custom pipeline components. 

This new version
supports IDisassembler and message spitting.  It also has useful comments for each
method explaining what each one does and how to use them.

This wizard can be
downloaded from his GotDotNet Workspace.

CS2002 documentation refresh

A new refresh of the Commerce Server 2002 and Commerce Server 2002 FP1 Documentation has just been made available (this is version 5 of the CS2002 documentation).  You can download these refreshes from:



  • Commerce Server 2002 – Enterprise, Developer, and Standard Edition Documentation (English only at this time)
  • Commerce Server 2002 FP1 – Installation Guide, Product Help File, BizDesk Help File (see the links to the right under “Related Resources”)

BizTalk 2006 Beta (Last one to comment?)

Will this be the last place on the web that trumpets the BizTalk 2006 beta? 
Likely not, but I did see it in quite a few places today.

Head to http://beta.microsoft.com with your
passport and ‘BizTalkBetaTeam’ for a guest ID, and then wait patiently.  (While
you’re waiting, consider building out a VPC image with VS2005 beta 2 and, presumably,
the latest SQL 2005 bits.  SQL 2000 would be fine as well, as BizTalk 2006 will
not require SQL 2005.)

This…is going to be a great release.  Nothing so revolutionary that you can’t
leverage all the skills that you (or your staff) have already learned. 
Yet, there are many, many important feature additions and “rough edges” removed.

Rattling off a few of the new items:

  • In-order delivery for any adapter that supports it (i.e. MSMQ, MQSeries, etc.) 
    In 2004, only MSMQ/T supported this.  (Of course, a faulty orchestration can
    break first-in-first-out – more on that in a later post.)
  • The introduction of an “Application” concept for grouping BizTalk assets
    – which extends to orchestrations, role links, send port groups, send ports, receive
    ports, receive locations, policies, schemas, maps, pipelines, other resources
    (e.g. soap proxies),  you name it!  Just as importantly, the management
    infrastructure understands applications – so health/management views can be narrowed
    down appropriately.
  • The management infrastructure has been completely encapsulated in an MMC – HAT is
    largely hidden.  More interesting is that the MMC can manage multiple BizTalk
    groups
    – and can do so remotely (by definition…)
  • A packaging/deployment solution that looks good – we’ll have more to say about that
    in the coming weeks!  The developer experience in particular looks to be quite
    good.  Likely still some value-add to be done on the server side.
  • Ability to route failed messages – and subscribe in your orchestrations.
  • Calling pipelines from within orchestrations (no more loopback adapter or similar
    solutions needed…)
  • Zoom and expand/collapse-state-preservation within orchestrations.  (So when
    you collapse that big group or scope shape, it will stay collapsed across
    close/re-open.)
  • BAM integration with SQL Notification Services.
  • “Operator Role” has been defined to make allocating administration tasks a bit easier
    from a security perspective.
  • Pipelines can have per-instance configuration – saving you from recreating what were
    essentially a lot of duplicate pipelines!  (This was possible in 2004, I believe
    – but not exposed cleanly.)

This will be fun…I look forward to exploring the beta bits (man, the CTP was pretty
short-lived…!)