BizTalk Server: Few basic changes for performance optimization

There are tons of recommendations and guidelines to tune the BizTalk Server to achieve the required performance, however there are few basic and very common things which we always miss while setting up a new environment

I have published a technet wiki article about “BizTalk Server: Tuning and Optimization” however below are few which is very basic and should always be kept in mind IMO.

  • Host Distribution Scheme : There should be a host creation schema for the BizTalk environment, before creating anew host , It is always necessary to decide the right Host Instance Node within a BizTalk group. following should be some basic points while creating a host instance and a new host
       1- Do we really need a new Host?
       2- What about using an existing Host and create a new Host Instance rather.
       3- What is the current load on target BizTalk node , where the new host instance is going to be created
       4- Always maintain a list of Host and they Host instance deployed by application. It will be easy to get the idea
  • Group Level Tracking – Group level tracking should be turned off.
  • BizTalk Database health – It is always necessary to keep an eye of the BizTalk group database server and its Jobs. Make sure the jobs are always running and there are no error in the SQL Agent logs.
  • Dedicated Tracking Host – There should be a dedicated Tracking host for BizTalk group.
  • Log and Data Files- data and log files of the BizTalk SQL server should always be on a separate drive.

Following are my main resources when i am dealing with Performance issues:

  1. General BizTalk Server Optimizations
  2. BizTalk Server: Performance Tuning & Optimization

Thanks for reading!

Advertisements

BizTalk Map using custom XSLT

Problem

There is a requirement to generate output XML based on the attributes of input XML:

Following is my Input xml schema

InputSchema

And our output schema looks like below

outputschema

I have to map the “Property” and its attribute “Name” based on the values and name of the input schema “Branch” record. for each “Branch” in the input there should be one record of the “Location” in the output schema.

For example if below is our input XML :

inputxml

Then my output XML should be like below

outputxml

If you see in the output XML the property and its values are populated on the basis of incoming records in “Branch”.

Solution

I would do following to achieve this requirement, My favorite custom XSLT in BizTalk Maps:

It is very easy to generate a Custom XSLT, BizTalk Map generates the basic code for the schema namespace etc and then we can always modify it.

Steps:

  • Add a new MAP in the BizTalk project
  • Choose the input schema and output schema
  • after this the MAP should look like below:

Map1

  • start mapping the elements and records from input to output. So simple
  • We have to map the value of “Availability” to the value of “Property” and the “Name” attribute should be populated with “Availability” , So I would simply connect “Availability” to “Property” and use a concatenation functoid to assign the attribute “Name” to “Availability” . My map Will look something like below:

map2

  • Now I will generate my basic XSLT code which i will further modify. I will validate the MAP and after the validation I will get the basic XSLT which i will modify.
  • Right Click on the map in the solution explorer and Click “Validate” , Check the Visual Studio output window, there will be a message something like below

map3

  • Open the XSL file highlighted and save that in the BizTalk solution . Now we can modify this XSL file and use in our MAP.
  • to use the XSL file in our MAP we would need to delete all the links which we have done in the above steps and use the “Custom XSLT Path” property of the BizTalk MAP,
  • Delete all the links in the map
  • Open the MAP property and select the path of the XSL file which we have saved earlier.
  • After that my map looks like below:

map4

  • And we can now test the map using our Input.
  • The final XSLT looks like below, which does all the mapping.

<xsl:output omit-xml-declaration=”yes” method=”xml” version=”1.0″ />
<xsl:template match=”/”>
<xsl:apply-templates select=”/s0:QueryInput” />
</xsl:template>
<xsl:template match=”/s0:QueryInput”>
<ns0:QueryResponse>
<xsl:for-each select=”s0:Branch”>
<xsl:variable name=”var:v1″ select=”userCSharp:StringConcat(&quot;OnOrder&quot;)” />
<xsl:variable name=”var:v2″ select=”userCSharp:StringConcat(&quot;ETA&quot;)” />
<xsl:variable name=”var:v3″ select=”userCSharp:StringConcat(&quot;Availability&quot;)” />
<ns0:Location>
<ns0:Name>
<xsl:value-of select=”@Name” />
</ns0:Name>
<ns0:Quantity>
<xsl:value-of select=”s0:Availability/text()” />
</ns0:Quantity>
<ns0:Property>
<xsl:attribute name=”Name”>
<xsl:value-of select=”$var:v3″ />
</xsl:attribute>
<xsl:value-of select=”s0:Availability/text()” />
</ns0:Property>
<ns0:Property>
<xsl:attribute name=”Name”>
<xsl:value-of select=”$var:v1″ />
</xsl:attribute>
<xsl:value-of select=”s0:OnOrder/text()” />
</ns0:Property>
<ns0:Property>
<xsl:attribute name=”Name”>
<xsl:value-of select=”$var:v3″ />
</xsl:attribute>
<xsl:value-of select=”s0:ETA/text()” />
</ns0:Property>
<xsl:value-of select=”./text()” />
</ns0:Location>
</xsl:for-each>
</ns0:QueryResponse>
</xsl:template>
<msxsl:script language=”C#” implements-prefix=”userCSharp”><![CDATA[
public string StringConcat(string param0)
{
return param0;
}

]]></msxsl:script>
</xsl:stylesheet>

Hope it helps!

Thanks for reading!

Windows 8 Beta Download

Windows 8 Beta version for community preview is out,Great Job by Microsoft! It is really amazing, You can download the ISO from here

While downloading the iso , Feel free to watch & enjoy the awesome preview here

Also there is a complete technet page for Windows 8, here, with lots of other options for the product.

Dont forget to see the product details page here .

Go grab it and start playing , Its really awesome!!

Thanks for reading!