Mohammed Atef’s Technical blog

BizTalk Host Throttling

Introduction

Today i am going to talk about Host Throttling, here i am trying to define Host Throttling and it is types . Really all this information are found at Microsoft BizTalk MSDN, but i am trying to reorganize this information to be quick and useful information.

Host Throttling

Host
Most of the processing that takes place on a BizTalk server occurs within host instance, which is a process running as a Windows service.
Throttling
Manage the use of resources by a host instance process, BizTalk Server utilizes an adjustable throttling mechanism that governs the flow and processing of messages through a host instance
Throttling Benefits
  • Moderates the workload of the host instance to ensure that the workload does not exceed the capacity of the host instance or any downstream host instances.
  • Detects when available resources are being underutilized. If available resources are underutilized then the throttling mechanism allows additional messages to be processed by a host instance
Throttling Configuration
Throttling configuration parameters are set on a per host basis in the BizTalk Server Administration console,
Throttling Configuration Scope
Throttling configuration parameters that are set for the host apply to any or all receive handlers, send handlers, or orchestrations that are housed in the corresponding host instances.

Now lets view two types of Host Throttling

Inbound host throttling Outbound host throttling
Known as
message publishing throttling in BizTalk Server message processing throttling in BizTalk Server
applied to
receive adapters or orchestrations that publish messages to the MessageBox database orchestrations or send adapters that receive and deliver or process messages that have been published to the MessageBox

 

When condition triggered

  • The amount of memory, the number of threads, or the number of database connections used by the host instance.
  • Downstream hosts are unable to process the messages that are published
  • The Message publishing incoming rate for the host instance exceeds the Message publishing outgoing rate
  • The amount of memory, the number of threads, or the number of database connections used by the host instance.
  • The Message delivery incoming rate for the host instance exceeds the Message delivery outgoing rate
  • The number of messages being processed concurrently by the host instance exceeds the In-process messages per CPU
Severity change and actions
  • delay may be implemented when an End Point Manager (EPM) thread receives a batch of messages from the transport adapter
  • EPM submits a batch of messages to be published into the MessageBox database
  • The number of threads that are available to (EPM) is restricted
  • A progressive delay in the processing logic of the host instance is implemented before delivering the messages to the outbound transport adapter or the orchestration engine for processing the messages.
  • The number of messages that can be held by the in-memory queue is limited.
  • The size of the Message Agent thread pool is limited. By limiting the Message Agent thread pool size, the host throttling mechanism effectively reduces the amount of messages that are delivered to XLANG and adapters.
Default configuration
EPM is configured to use 20 threads per CPU the in-memory queue is set to hold 100 messages per CPU
Diagram
image image

I Hope that helped

November 3, 2009 Posted by mohammedatef83 | Biztalk | , | No Comments Yet

Monitor BizTalk 2009 Applications

Introduction

I have found question at Microsoft BizTalk Forums about how to retrieve all BizTalk Application with none started status.

Solution

An Expert MVP called Thiago AlmeidaMVP has answered and advice for using BizTalk ExplorerOM assembly. i have used it to create simple windows application that show all BizTalk application with status in DataGridView.

Understand code

Let us see main code used to retrieve BizTalk application and it is status in the below snippet:

   1: BtsCatalogExplorer catalog = new BtsCatalogExplorer();
   2: DataTable apptbl = CreateAppTBL();
   3: //connection string to BizTalk management database
   4: catalog.ConnectionString = "SERVER=.;DATABASE=BizTalkMgmtDb;Integrated Security=SSPI";
   5: DataRow dr;
   6: foreach (Microsoft.BizTalk.ExplorerOM.Application app in catalog.Applications)
   7: {
   8:     dr = apptbl.NewRow();
   9:     dr["AppName"] = app.Name;
  10:     dr["AppDesc"] = app.Description;
  11:     dr["AppStatus"] = app.Status;          
  12:     apptbl.Rows.Add(dr);
  13: }
  14: return apptbl;

As shown above i am going to retrieve all applications throw BtsCatalogExplorer then use Foreach loop to fetch each application individual and finally fill DataTable with information needed.

now i am going to give you simple description about ConnectionString property found at BtsCatalogExplorer .

ConnectionString : is used for gets or sets the string used to open BizTalk Management database as shown above i have installed BizTalk at local server so i have wrote server=. to point to local server database and BizTalk Database is BizTalkMgmtDbso i have set DataBase with BizTalkMgmtDb value.

you can download full sample from here.

I hope that help.

October 21, 2009 Posted by mohammedatef83 | Biztalk | , | No Comments Yet

Check and uncheck all checkboxes in GirdView without any server side code

Introduction

I was searching for JavaScript method that check or uncheck all checkboxes in GridView using check box in header. actually i have find more of solution but no one can be generic or must write code in server side in Gridview_databound event. i have wrote this article to introduce new solution generic for any normal GridView.

Idea

My idea here is getting all html controls from type input and check if the control type is checkbox or not then update checked value depending on Boolean value send to method.

Understand Code

kindly find Javascript code for this issue below

   1: function CheckAllDataGridCheckBoxes(checkVal,id)
   2:  {     
   3:     var gvid=GetGridViewID(id);
   4:     var checkboxx = document.getElementsByTagName("input");
   5:     for (i = 0; i < checkboxx.length; i++) {
   6:         if (checkboxx(i).type == "checkbox" && checkboxx(i).id.indexOf(gvid)!=-1 ) {
   7:             checkboxx(i).checked = checkVal;
   8:         }
   9:     }
  10: }
  11: //used to get grid view id from chkall check box id
  12: function GetGridViewID(chkallid)
  13: {     
  14:     var underscorindex=chkallid.lastIndexOf("_");
  15:     var gvname=chkallid.substring(0,underscorindex-1);
  16:     underscorindex=gvname.lastIndexOf("_");
  17:     gvname=gvname.substring(0,underscorindex-1);
  18:     return   gvname;
  19: }

Parameters

checkVal:is Boolean hold true or false comes from checked value of checkbox found in GridView header

id:is id for check box found in GridView header.

How it is working?

I think any Javascript developer can understand the above code but i need to explain why i have used GetGridViewID method, acually i found Javascript method like CheckAllDataGridCheckBoxes but it have one issue, it is checking all check boxes found in your form that why i am using GetGridViewID method.

GetGridViewID this method is doing the following

1- Any checkbox under gridview id is following this pattern GridViewClientID_ctrl(0…n)_CheckBoxName

so in line 14 and 15 i get last index of _ character and substring id to this index it mean i have now  GridViewClientID_ctrl(0…n) in gvname

2-line 16,17 get the next last index of _ charchter and substring to this index it means i have now GridViewClientID in gvname so now i have the clientID for GridView.

How to use

To use this JavaScript method write the following in onClick event for CheckBox found in grid view header.

onClick="javascript:CheckAllDataGridCheckBoxes(this.checked,this.id)"

I hope this helped

October 7, 2009 Posted by mohammedatef83 | Asp.net | , , | No Comments Yet

Create Generic Collection with Generic Binding Method for Dropdown List

Introduction

At this post i am going to show you how to create generic collection class with generic method for binding any Dropdown List.

Solution

I will describe my code in steps as follows

Step one Create Generic class

here we will create generic class as shown below

   1: Imports Microsoft.VisualBasic
   2: Public Class GenericCollection(Of T)
   3:     Inherits CollectionBase
   4:     Public Function Add(ByVal value As T) As Integer
   5:         Return List.Add(value)
   6:     End Function
   7:     Public Sub Remove(ByVal value As T)
   8:         List.Remove(value)
   9:     End Sub
  10:     Public ReadOnly Property Item(ByVal index As Integer) As T
  11:         Get
  12:             Return CType(List.Item(index), T)
  13:         End Get
  14:     End Property
  15: End Class

In the above code you need to note the below step:

1- Our class inherits from CollectionBase

2- Add method take any kind of object T and add it to collection list

3- Remove method delete kind of object T and remove it from collection list

4- Item property return object of T

Step two Create Generic Method to Bind any Dropdown List

find code for this method here

   1: Public Shared Sub FillDDL(ByRef ddl As DropDownList, ByVal col As CollectionBase, ByVal strval As String, ByVal strname As String)
   2:         ddl.DataSource = col
   3:         ddl.DataTextField = strname
   4:         ddl.DataValueField = strval
   5:         ddl.DataBind()
   6:     End Sub

I think any one can understand the above code but note that col parameter is from try collectionbase to path any type of object class.

Step Three how to use this code

find code for using Generic class and method

   1: Dim col As GenericCollection(Of Priority) = priorityprov.GetAllPrioritysGeneric()
   2: CtrlHelper.FillDDL(ddlpriority, col, "PriorityID", "PriorityArName")

in the above code assume the following

1- CtrlHelper is the class which contain FillDDL generic method

2- GetAllPrioritysGeneric() is method return genericcollection of type Priority

conclusion

at the end now you have common class for any collection and common method for binding any Dropdown List in any solution.

I hope this helped

October 6, 2009 Posted by mohammedatef83 | Asp.net, C#,VB.Net | , | 1 Comment

Master Details GridView with Details inside same GridView

Introduction

I have been worked for implementing Gridview which contain linkbutton in each row that link must be show user details in same row using Detail View Control.

Solution

I have developer normal Gridview and did the following steps

1-drag GridView and Detail view control into my page

2- bind Gridview in page load event

3- add 3 template fields and one command select field

4-add labels with unique names in each template field

5-add the following code in GridView RowCommand Event
 

   1: If e.CommandName = "Select" Then
   2:             Dim userid As String = CType(GridView1.Rows(Integer.Parse(e.CommandArgument)).Cells(0).FindControl("lbluserid"), Label).Text
   3:             DetailsView1.DataSource = GenerateUserDetTable(GenerateUserDetTable(Nothing).Select("userID=" + userid)(0))
   4:             DetailsView1.DataBind()
   5:             GridView1.Rows(Integer.Parse(e.CommandArgument)).Cells.RemoveAt(0)
   6:             GridView1.Rows(Integer.Parse(e.CommandArgument)).Cells.RemoveAt(1)
   7:             GridView1.Rows(Integer.Parse(e.CommandArgument)).Cells(0).Text = ""
   8:             GridView1.Rows(Integer.Parse(e.CommandArgument)).Cells(0).ColumnSpan = 2
   9:             GridView1.Rows(Integer.Parse(e.CommandArgument)).Cells(0).HorizontalAlign = HorizontalAlign.Center
  10:             GridView1.Rows(Integer.Parse(e.CommandArgument)).Cells(0).Controls.Add(DetailsView1)
  11:             Dim lnk As LinkButton
  12:             lnk = New LinkButton
  13:             lnk.CommandName = "Hide"
  14:             lnk.Text = "Hide"
  15:             GridView1.Rows(Integer.Parse(e.CommandArgument)).Cells(1).Text = ""
  16:             GridView1.Rows(Integer.Parse(e.CommandArgument)).Cells(1).Controls.Add(lnk)
  17:         End If

Understanding Code

the whole idea is to remove not needed cells and reset the Column span for the remaining cell and adding detailView into this cell lets see how you can do this

at line 1 i get user is from row that user click show linkbutton there

at lines 5,6 i have removed not needed cells

at lines 8,9,10 i have update remaining cell properties and add Detailview to it

at lines 11 to 16 i have create new linkbutton and replace it with the Show link button

note that GenerateUserDetTable is a method that generating UserDetails Table

you can download the whole project from here


Hope that helped.

September 30, 2009 Posted by mohammedatef83 | .Net 2010, C#,VB.Net | , , , , , | No Comments Yet

AutoComplete DropDownList using JavaScript

Introduction

Today I am going to present VB.net method that create AutoComplete DropDownlist dynamically .I have used JavaScript code for generating AutoComplete DropDownlist from this site

I have created two methods one for creating dropdown list and another to create Div control dynamically. second method use RegisterStartupScript method for registering some java script code used in my sample.

First method code like following

Public Function CreateDDL() As DropDownList
Dim ddl As DropDownList
ddl = New DropDownList
ddl.Attributes.Add(“name”, “alfa1″)
ddl.ID = “combo_zone1″
ddl.Items.Add(“aaaa”)
ddl.Items.Add(“aa1″)
ddl.Items.Add(“aas”)
ddl.Items.Add(“asdf”)
ddl.Items.Add(“bbb”)
ddl.Items.Add(“b111″)
ddl.Items.Add(“bbb43″)
ddl.Items.Add(“ddd”)
ddl.Items.Add(“dbbd”)
ddl.Items.Add(“eee”)
ddl.Items.Add(“eeea”)
ddl.Items.Add(“aase”)
ddl.Items.Add(“nnnmmm”)
ddl.Visible = True
Return ddl
End Function

I think it is clear method I have just create DropDownlist and assign name attribute and id for it and finally added some items

Second method fond below

Public Sub CreateDiv()
Dim dv As New HtmlControls.HtmlGenericControl(“DIV”)
dv.ID = “newdv”
dv.Attributes.Add(“class”, “content”)
dv.Controls.Add(CreateDDL())
Dim scriptstr As String = “”
scriptstr = “<script type=’text/javascript’>”
scriptstr = scriptstr + ” ” + “var z=dhtmlXComboFromSelect(‘combo_zone1′);”
scriptstr = scriptstr + ” ” + “z.enableFilteringMode(true);”
scriptstr = scriptstr + ” ” + “</script>”
dv.Visible = True
form1.Controls.Add(dv)
Page.ClientScript.RegisterStartupScript(Me.GetType(), “startup”, scriptstr)
End Sub

At this method I have created div control dynamically

And I have added the DropDownlist control from by calling the first method and finally I have register the JavaScript code into this div.

You can donload full sample from here

I hope that helped.

September 13, 2009 Posted by mohammedatef83 | Asp.net | , , , , | No Comments Yet

Canonical schemas

Introduction

Canonical Schema is doing the same using for Canonical data model which designed to communicate between different data formats, actually this pattern used to decease the cost of integration developments while you are doing enterprise application integration and also it is used heavily in SOA solutions.

Problem

suppose you have five different schemas and you are going to integrate between them what you can do?

Solution without Canonical Schema

you will do integration and mapping between each schema you need to integrate with the other one.so you will do the below design pattern.
canonical schema1

the problem of this solution that you are was a lot of time for mapping and integrating each schema.

Solution Using Canonical Schema

you can create common schema called(Canonical Schema) and at any given time you can translate to or from this schema. it is seems you have only one schema and any other schema can transform to it, i think it will be better for you now.so kindly find the pattern design using Canonical Schema in the image below:

canonical schema2

I hope that helped.

August 19, 2009 Posted by mohammedatef83 | Architucture, Biztalk, Design Patterns, SOA | , , , | No Comments Yet

Covert Complex SQL In clause to a business rule

Suppose you have Complex SQL Stored procedure and you would like to do this Complex SQL operation into BizTalk Business Rule Engine, what can you do??

Let see Example for This…
we need to transform the below SQL script to BRE
Update a Set a.policy=150
from a
Inner join b
on a.id=b.id
Where a.xx=100 and a.yy in (3,10) and b.zz=1
To solve this issue follow this steps
1- create view contain SQL join.
2- Use IF statement in Business Rule
by adding in the if condition a.xx=100 and a.yy in (3,10) and b.zz=1
and put the set action into if condition action
I Hope this Help.

July 29, 2009 Posted by mohammedatef83 | Biztalk | , , | No Comments Yet

How to Setup Microsoft Dynamics CRM for Outlook

One of the most Important features for Microsoft CRM Dynamic 4.0 is integration with Microsoft Office Outlook to do this just follow the following steps

1- Go to you CRM Install Package and copy the client folder into your client machine

2- run the setup file named SetupClient.exe

3- make sure you have installed the .net framework 3.0 or later and Microsoft Visual c++ runtime 8.0 or later.

4- important note the i have write this post for it

if you do not have Microsoft Visual C++ runtime installed download it and put it in folder named VcRedist then copy this folder beside the EXE file mention in step 2

5- after the installation finished go to Microsoft Office Outlook you will find big link in the top of you personal outlook named configure CRM Dynamic just click this link and follow the wizard till you finish.

6- now you can find all activities you authorized to access from Microsoft Dynamics SRM 4.0 available into you Microsoft Office Outlook….. Good Luck.

I hope this help.

July 29, 2009 Posted by mohammedatef83 | CRM Dynamics 4.0 | , , | No Comments Yet

IIS 7.0 Web Deployment Tools

Today i am going to talk about IIS 7.0 new feature in deployment and packaging.First you must know that all the new extension for IIS 7.0 are found in Microsoft Web Platform Installer you can download it from here, this is a free tool that makes it simple to download, install and keep up-to-date with the latest components of the Microsoft Web Platform, including Internet Information Services (IIS), SQL Server Express, .NET Framework and Visual Web Developer.

so to do our new features of deployment please download and install it.

Now let’s take a look for the new deployment feature found in IIS 7.0

1- Synchronize web application

I think all of you was trying to move his web application from QC or Dev environment to production server and was a lot of time for build the new package and deploy it, but now using IIS 7.0 you do this stuff in few seconds by one line of dos command.

just go to dos command window and write the below line
C:\program Files\IIs\Microsoft web deploy>msdeploy –verb:sync –source:apphostconfig=[webapplicationname] –dest:auto,computername=[destination server name]

assume the following
[webapplicationname] is the web application name that you are trying to move it from on server to another.
[destination server name] is the destination server name.

after writing this line of command press Enter Key then you can find the new web application found into your IIs destination server.

2- Package

IIS 7.0 has also nice feature for package you web site in easy and quick way you need to follow this steps only

Right click->Package and Install->Package Sites and Applications
after that just follow the wizard to finish this stuff.

3- Deploy

After creating the package you need to deploy it to another server…yeah IIS 7.0 also doing this step for you in the below few steps

Right click->Package and Install->install sites and applications

I think you are happy now you can do many tasks in few minute using IIS 7.0 .. Good Luck but for you information IIS 7.0 has more and more new feature try to learn it.

I Hope this Help.

July 27, 2009 Posted by mohammedatef83 | .Net 2010 | , , | No Comments Yet