March 2008 - Posts

Restoring BizTalk ports and orchestrations after maintenance shutdown
31 March 08 08:02 PM | wmmihaa | 1 comment(s)

Given a scenario where you have a maintenance window, and need to shut down one or more applications, you might find it challenging when you are going to start them up again.

If you are working with a large BizTalk solution, the Application Stop and Start functionality might not be useful. -If you had ports that where disabled, stopped or unenlisted before shutting the application down, these will also be started when starting up the application again. If these ports and orchestrations where disabled for a reason, this approach will not be acceptable.

If you have separated your BizTalk hosts into Receive-, Send- and Processing ones, you could solve the problem by stopping the host instances in the right order, rather than the Applications. But if you only want to stop and start some of the applications, you'd be required to have three host instances per application, which is highly unlikely.

I've seen customers work with WMI scripts to solve this problem, and even though this works, it takes for ever to execute these scripts.

-So, if you are looking for a tool where you'd be able to stop an Application or the entire BizTalk group, and bring it back up again (as it looked before you shut it down), this tool might be what you're looking for.

The console application has functionality to take a "snapshot" from what your BizTalk group looks like. The snapshot is stored in an xml file, which you can modify manually if you like. You can start or stop the entire BizTalk group or just one application at the time. When execution the [start] command, you'll be prompt to select the snapshot file to use.

Usage:

snapshot

The user will be prompt to type the name of the snapshot file, to which the state of all ports and orchestrations will be saved.

snapshot

stop -[Application] or [* = all applications]

This command will stop every port and orchestration from specified application. The user can optionally make a snapshot before executing the command. Before committing the changes, the user is presented a view of what is going to happen.

stop

start -[Application] or [* = all applications]

The user will be prompt to specify which snapshot file to use. Only the ports and orchestrations that where started/enabled before the snapshot was taken will be started. Before committing the changes, the user is presented a view of what is going to happen.

start

 

Binaries: BizTalkManagerConsole.zip

Filed under: ,
BizTalk migration – Testing
18 March 08 07:04 PM | wmmihaa

When migrating from BizTalk 2004 (or possibly 2002) to 2006 one might feel tempted to do some refactoring at the same time, fixing things you (or somebody else) could have done better the first time. If the migration is done from a large BizTalk solution, you probably want to make sure everything works as it did before, without spending to much time testing. After all, it’s "just" a migration project.

So if what you are looking for, is some kind of regression testing, leaving your developers to focus on the migration task, you might find this post useful.

The basic principle here is letting messages, passing through the old environment, also passing through the new 2006 solution, and ending up being validated to match each other. It is important to understand that this testing process will only test the content of the message and not any possible connectivity problems. It will require you to deploy your 2006 ports using the File adapter on both receive and send port side. Upon deploying your solution to the production environment these ports would need to be changed to whatever binding you used before. An other important thing to understand is that this process only works with one-way ports. 

To make this happen we need to add a pipeline component at the beginning of every pipeline in the old environment. This component will archive the incoming message to the location where the Receive Location in the new environment will pick it up. Hopefully you can achieve this by copying every pipeline to one new Visual Studio 2003 project, and add the pipeline component to the new pipelines.

The archive component should be designed to require as little system resources as possible, why it uses a Forward only event streaming manner, which basically prevents the stream from being read more than once. To learn more about ForwardOnly streaming, have a look at Johan's blog post.  

image

Having the updated pipeline assembly, all we need to do is to (1) add an additional Send Port with identical filter settings, and (2) change the pipeline to the updated one, and (3) set the archive path to where ever you set the receive location to in the 2006 environment.

When you’ve done this, the orchestration will pick up the files from the Send Port locations and check if they are identical. The result will be sent to the database, along with the actual messages, for later use.

clip_image002

The orchestration is generic and can be used for every scenario. It has an parallel shape which will prevent it from continue until it receives two files with identical names. To ensure the names comes out with the same name, the pipeline component mentioned above, will promote the ReceivedFileName property (file-property namespace) if it is not set. This will be the case when the original message, for instance, is received from an MQ adapter.

It will then proceed and send the incoming messages to an archive, where you can later pick them up if you need to analyze its content. Next is a decision shape where the actual matching is done. The result will be inserted into a database table, which you may later query to get all failed messages (if any).

If you find this post of interest, let me know, and I'll post the source code.

Filed under: ,
BizTalk Sftp Adapter - updated to support dynamic send ports
18 March 08 06:35 PM | wmmihaa | 1 comment(s)

We were asked if the adapter supported dynamic send port, and if it was configurable from within orchestrations. As this was not the case, Johan found himself compelled to solve this. Although the documentation is not yet updated, the source code and setup files are released at codeplex.

If you want to know more about how to use the adapter with dynamic send port, have a look at Johans blog post.

Filed under: , , ,
BizTalk Sftp Adapter - Troubleshooting
05 March 08 04:37 PM | wmmihaa

We’ve used and tested this adapter extensively for my former customer, and when correctly configured, we haven’t had any major issues. However, you might find it challenging to use due to other factors such as generating identity key files, opening of firewalls, installing Sftp servers etc.

The exchange of keys is a particular annoying topic. If you are already familiar to the Sftp protocol, you might not see this as an obstacle, but generally when using BizTalk you’d be given any necessary authentication information, and from there you’d go on and configure your port.
In the scenario of using a Sftp adapter, BizTalk would be the client, and would therefore have the private key (in contrast to ssl, where the host has the private key). The owner of the host system will require a public key from you, to create a user account. When given that account, you’re now able to configure and test your adapter.

This might not seem as a problem, but in my experience it is. The fact that the host system ower (if he or she exists), is often not the person who would do the actual work, which means you’d have yet another (Unix) person to talk to. This will increase the possibility of anything going wrong.

Of cource you may use user name/password as authentication, in case you can disregard all I've said... 

Rather than using BizTalk, you may find it easier to use a console application to make sure the connection is working. You could also use other applications such as Tunnelier, for the same reason, but it might work differently. Below you find a simple sample of what the code could look like. Make sure to reference the Blogical.Shared.Adapters.Sftp assembly:

class Program 
    { 
        static void Main(string[] args) 
        { 
            string host = System.Configuration.ConfigurationSettings.AppSettings["host"]; 
            string user = System.Configuration.ConfigurationSettings.AppSettings["user"]; 
            string pass = System.Configuration.ConfigurationSettings.AppSettings["pass"]; 
            string keyfile = System.Configuration.ConfigurationSettings.AppSettings["keyfile"]; 

            using (Sftp sftp = new Sftp(host, user, pass, keyfile)) 
            { 
                try 
                { 
                    sftp.Connect(); 
                    Console.WriteLine("Connected"); 
                    sftp.Disconnect(); 
                } 
                catch (Exception ex) 
                { 
                    Console.WriteLine("-=<>=- EXCEPTION"); 
                    Console.WriteLine(ex.Message); 
                    Console.WriteLine(ex.StackTrace); 

                    int i = 1; 
                    while (ex.InnerException != null) 
                    { 
                        ex = ex.InnerException; 
                        Console.WriteLine("-=<>=- INNER EXCEPTION " + i++); 
                        Console.WriteLine(ex.Message); 
                        Console.WriteLine(ex.StackTrace); 
                    } 
                } 
            } 

            Console.WriteLine("Test completed. Press Enter to Exit application."); 
            Console.ReadLine(); 
            Console.WriteLine("Terminating..."); 
        } 
    } 

Another thing…the UseLoadBalancing property on the receive endpoint is by default set to true. This is going to cause you problems if you haven’t created the database table. Make sure to set it off, if you are not going to use it.

BTW, Thank you Johan for providing the code sample above...

Filed under: , , ,
BizTalk Sftp Adapter released at CodePlex
01 March 08 10:40 PM | wmmihaa | 4 comment(s)
I’ve developed this adapter for a customer who needed to transfer files independent from any choice of platform. Much concern for security, along with already invested infrastructure, where the main reasons for choosing Sftp in favor other protocols like Ftp or Ftps.

 

For more information and downloads: http://www.codeplex.com/SftpAdapter 

 

For mor information about the SSH File Transfer Protocol

 

I plan to post some articles about trubleshooting since I left this out in the documentation.

 

You may use this adapter as you like, but please keep me posted for any changes you make. This way my former customer will benefit from sharing this adapter with the open source community.

 

Good luck.

 

Filed under: , , ,

This Blog

News

    MVP - Microsoft Most Valuable Professional BizTalk User Group Sweden BizTalk blogdoc

    Follow me on Twitter Meet me at TechEd

    Visitors

    Locations of visitors to this page

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Syndication