Wordle

Wordle: BTS3

Sunday, February 22, 2009

Race condition when working with BizTalk SQL Adapters in Cluster or Group

When working with adapters on multiple hosts group (or in a cluster), keep in mind that enabling an adapter (especially SQL Adapter) perform the command (Select or Stored procedure) on every host at the same time and can cause a race condition.

While FTP, MSMQ and POP3 adapters are listed in the guide to be clustered (and not grouped) the SQL adapter is not listed and therefore can be groups – and will be running on every host.

In this case, the SP road should be taken (and not Select directly from the table) and implementation of locks should be executed in the SP.

See http://msdn.microsoft.com/en-us/library/cc507804.aspx for more details (Recommendation 5).

Shimshon

Tuesday, January 6, 2009

Using Script when developing BizTalk projects

After evaluating some reference options, I decided that the best way to reference a DLL in BizTalk project environment is to create a Bin folder that holds the last compiled version of every DLL and in the other projects, add reference to this Bin folder.

It's quite easy to do when non-BTS projects are used. Just add the copy command to the post build events. I'm also adding the command to GAC the DLL (gacutil).

But a BTS project doesn't have the build events option.

So we are using some batch files to do these commands, controlled by the developer.

First we are copying the DLL to our BIN folder. Next we are GACing this DLL, using gacutil command.

Later on we are using the BTSTask command to deploy the DLL into BizTalk management.

We are also holding a batch file that creates the proper application in the management tool (again, using BTSTask).

These batch files, if written properly, can be used later on to deploy the project into the build machine, testing environment (UAT, INTG) and even the production environment.

For me, using these batch files, shorten the development time (especially when solving bug and recompile, redeploy are involved) and simplify the deployment to higher environment

Samples:

Creating the application:

BTSTask AddApp -ApplicationName:%BTSApp%


 

GAC dlls:

gacutil -if %InstalBin%\GS.BTS.Meches.CustomPipelineComponents.dll

if ERRORLEVEL 1 EXIT /B 0

Copy to Bin folder:

XCOPY %Root%\BTS\GS.BTS.Meches.CustomPipelineComponents\bin\%DLLEnv%\GS.BTS.Meches.CustomPipelineComponents.dll %InstalBin%\

if ERRORLEVEL 1 EXIT /B 0

BTSTask:

BTSTask AddResource -ApplicationName:%BTSApp% -Type:System.BizTalk:Assembly -Source:%InstalBin%\GS.BTS.Meches.CustomPipelineComponents.dll -Destination:%%BTAD_InstallDir%%\GS.BTS.Meches.CustomPipelineComponents.dll -Overwrite

if ERRORLEVEL 1 EXIT /B 0

Wednesday, December 31, 2008

BizTalk max receive locations using FTP Adapter and File Adapter

When considering developing of a business process which receive the incoming messages in mass multiple receive location using FILE or FTP adapters, one should know that a limitation exists depending on hardware performance which runs BizTalk servers.

In a particular project, we encounter this limit where 200 receive locations activated, both File and FTP adapters.

When large amount of messages arrives to those receive locations, BizTalk stops to collect these messages, and large amount of waiting threads can be found using performance monitor.

Our solution was to develop a specific .NET service which locate the messages in the locations and move the messages to one location, defined as the only one receive location.

Sunday, October 26, 2008

Software add-ons solutions – BizTalk, MsCrm, MOSS and more

One of the main business lines of my company (Guardian information systems: http://www.g-s.co.il) is to provide solutions for customers using Microsoft products, in the form of add-ons over the Microsoft products.

For that we are delivering in the near future a new web site in this address: http://www.softaddons.com

The site will hold the complete list of add-ons created by specialist in those areas (BizTalk, Dynamics CRM, MOSS and SharePoint).

Please see the complete list in the near future.

Shimshon

Wednesday, August 6, 2008

Saying no to: Complete BizTalk project processes without orchestrations

I'm thinking about this post for awhile now.

I was interviewing a developer which was candidate for a BizTalk development team leader.

One of his "sentences" was: "I'm only developing BizTalk processes which are not involved orchestrations. Rather than I'm developing everything needs to be done with port to port routing, pipelines and pipelines components".

It took me time to fully realize that this is, in my opinion, is not BizTalk. Although this can be done - as this guy already proves – I think that in cases my design would lead to the conclusion not to use orchestrations at all in the project, I would leave BizTalk aside in the project.

If everything that the project is needed is routing, probably that BizTalk overhead overcome the benefits from using BizTalk.

What do you think? I'll be glad to hear your opinions

Monday, May 12, 2008

Design patterns

Hello again,

I found out an explanation about design patterns in the blog of Gil Fink.

It is a fluent, short and summarizing explanation, which is, in my opinion the ideal explanation.

http://blogs.microsoft.co.il/blogs/gilf/archive/2008/05/10/factory-method-pattern.aspx

Shimshon

Wednesday, April 30, 2008

Semaphores vs. Singleton in order to manage limited resources in BizTalk

Everybody needs semaphores. In the last couple of months I myself encounter 3 times the need to use semaphores.

Since my primary job is BizTalk – I need a semaphore solution for BTS.

Searching the net for open source semaphore solution results with such solutions, but (the best I found) limited to the current server running the application.

Since my production environment of BizTalk servers holding more than one server, these solutions don't work for me.

BizTalk has an option to use singleton as a mechanism to control resources. This is how to do it using singleton:

  • Create orchestration A (Main) to handle the process
    • When need to use the limited resource do that
      • Send a message using direct binding to orchestration B
      • Receive response message from orchestration B
    • Continue the business process required in
  • Create orchestration B
    • Create a correlation set that will be used to identify the similarity between the messages arrives to this orchestration to make it unique BizTalk.
    • Receive the request from orchestration A and initial the correlation set.
    • Do the resource limited operation
    • Create a loop
      • Add a listen shape
        • On one hand Receive another message
        • On second hand add a timeout
      • If timeout occurred exist loop, and leave orchestration
      • If message received handle (again) the limited resource operation

(Detailed instructions can be found here: http://aspalliance.com/1208_Singleton_Orchestration_in_BizTalk_Server.3)

Here is a picture of orchestration demonstrating this solution:


Challenges when using this way:

  1. Unable to limit the number of resources in case the number of resources is larger than 1.
  2. There is no easy way to trace direct binding ports, and therefore to debug errors in the mechanism.
  3. There is no accurate time to leave the singleton orchestration (how much time to set in the timeout hand).
  4. It might cause a zombies message (although it pretty rear) when a message coming to the MessageBox after timeout event already fired and orchestration still did not complete termination.


We found out a different way to handle the limited resource problem and to offer a solution for it.

How about using an adapter to get a semaphore?

In this way the solution is very simple.

Once configure the adapter, many resources can be managed, and number of items per resource can be defined.

Construct a message including the semaphore name and number of resource items need to be obtained (not only 1, but 1 is the default), and send a message to the adapter to get the semaphore. After getting it do the business process required the resource and then release the resource by sending the same message again to the adapter.

The next picture demonstrates the same operation using the semaphore adapter.


Shimshon Fishler