We're looking at using Microsoft's ESB Guidance package to implement a message bus. The bus will be the core of the client's planned Service Oriented Infrastructure, and all existing apps will route communication through ESB. There'll be a few posts coming up covering what it provides, how to use it and some simple walkthroughs, but I'll start with a basic overview and installation tips.
Overview
Ignore the name - ESB (Enterprise Service Bus) Guidance is not a set of documents giving you best-practice guidance. It's a Microsoft-coded framework which sits on top of BizTalk 2006 R2 and provides services typically seen in custom service bus solutions (dynamic endpoint resolution, namespace resolution, policy-based messaging etc.). It's published by the Patterns & Practices team, so it comes with full source and samples, and no licensing costs are involved.
An exception handling layer is built into the framework, which supports attempted message repair and resubmission, and fault logging. The framework logs via BAM and the Guidance comes with a sample Management Portal, providing a rich Web interface for monitoring the health and performance of your service applications.
The main download is from MSDN: http://www.microsoft.com/downloads/details.aspx?FamilyId=E3957253-24CE-45AA-AC32-60ABFFE15BAC&displaylang=en , which contains source, samples, MSIs, and help file source. There's also a site on CodePlex which has a compiled help file in the Release: http://www.codeplex.com/esb. The Patterns & Practices home page for ESB Guidance is here: http://msdn2.microsoft.com/en-us/library/bb931189.aspx.
The help files provide a lot of detailed information on the framework itself and the samples provided.
Installation
As of version 1.0 (November 2007), installing ESB Guidance is not a straightforward task. The MSDN download comprises a single MSI file, but this just unpacks a raft of other MSIs (along with source files and help files), which need separate installation and configuration. The installation process is documented in the ESBDocs.chm help file, but that assumes you're doing a complete installation of all components.
There are a lot of prerequisites (SQL Server 2005 with SP2, VS 2005 with SP2, BizTalk 2006 R2, Enterprise Library 3.1, .Net 3.0 and various hotfixes), and if you want to use UDDI for endpoint resolution (ESB can use other sources, e.g. sets of BRE policies) you'll want to be running from Windows Server 2003 as UDDI Services isn't part of XP.
Depending on how much of this you have already installed, you'll need to allow at least a day for your first installation.
A friendly guide to installing ESB Guidance which describes what the components are and has a checklist of tasks and prerequisites is attached to Peter Kelcey's post here:
http://blogs.msdn.com/pkelcey/archive/2008/01/22/esb-guidance-installation-process-and-checklists.aspx
I've used this as the basis for successful installations, but found a couple of issues:
- Installing UDDI Services – do this after installing SQL Server 2005, but read this KB article first: http://support.microsoft.com/kb/927230
- SQL Server roles - ExceptionDB and Portal are mapped by the scripts so no need for this step (role names also differ from the PDF description)
- CreateBizTalkApplication.cmd failed to create the BizTalk app; built in Deployment mode and Deployed from VS then ran cmd again
- CreateBizTalkApplication.cmd failed to import BAM definition (could not find Microsoft.BizTalk.ESB.BAM.Exceptions.xls) – ran bm.exe manually
- Config files – having built the solution locally, there is no "Generated by BizTalk" so in BTS and machine config update instructions replace [path] with C:\Projects\Microsoft.Practices.ESB\Source\Core\Config (note be sure to escape the backslashes in the BTS config); ensure the assembly public keys are the correct ones:
Release (install from MSI): 31bf3856ad364e35
Dev (build & install from source): c2c8b2b87f54180a
-
ESB.Portal site not working after install; ran in debug from VS and fixed issues:
- removed "Network Library" and specified data source in connection strings
- fixed bug in SP EsbExceptionDb.usp_select_Fault_Count_By_Error_Type - isnull(@application, '') needs quotes escaped
- issue with session state in IIS 6, but I think that's just config in my ancient VM… The site runs fine under Cassini
-
The guide ends there, so you need to switch back to the main help file to carry on with:
- Setting up shares for the InfoPath templates
- Suggested reading for securing the Web services
- Installing the sample applications
Installing the Samples
If you've followed the installation guide and installed from source, your GAC assemblies will have a different public key from the release files, so you won't be able to install the sample rules from GlobalBank.ESB.Policies.msi (the help files suggest copying your assemblies over the one in the \bin directory, but that won't help as the MSI has keys in the policies that you can't change).
The source for the samples uses the correct key, so you can build and deploy from VS to create the sample app and populate the BRE components. A few of the samples have dependencies, so I installed in the following order:
-
Dynamic Resolution
- Build solution in VS
- Deploy from VS
- Run PreProcessingCORE.vbs
- Run CreateBizTalkApplication.cmd
- Check BTS Admin – if the policies are not in the GlobalBank.ESB app, they can be added through the UI
-
Resolver Service
- Steps 4 & 5, from the Resolver Service source
-
Scatter-Gather
- Add a reference to the Microsoft.Practices.ESB app from GlobalBank.ESB
- As steps 4 & 5, from the Scatter-Gather source
-
Itinerary On-Ramp
- As step 1 & 4, from Itinerary On-Ramp source
Verify the GlobalBank.ESB app contains all seven policies, and then you're ready to start trying to get the samples to work.
Community Resources
There are a few blogs out there, but I haven't found comprehensive coverage about using the framework in anger. Mikael Håkansson has useful posts about using and extending the framework: http://blogical.se/blogs/mikael/archive/tags/ESB+Guidance/default.aspx. If you know of any more useful resources, leave a comment and I'll add them to the post.