LoadGen

LoadGen

LoadGen is a Microsoft tool that can be used to generate test inputs to BizTalk solutions. The two features I really like about it are Message Creators, which allow you to generate different messages in each run (for example, different request id’s, guid’s, etc. in every generated file/message), and the Load Generators/Transports, which allow you to generate files, Http or Soap requests, Msmq messages, etc. A third architectural component are Throttlers, which allow you to regulate the rate at which documents are generated.

Load generation is just the first part of the problem when testing a BizTalk solution, however. You must have a way to measure how your solution is holding on, and for this a typical approach is using Performance Counters.

The download includes several samples, however most of these omit the configuration of Message Creators, which took me some time to get working. One thing to remember is that you can/should include the configuration of the Message Creator inside a Section block, at its end.

Here are some other quick tips:

  • LoadGen writes (verbosely) to the Event Log. Check it to find out if something is wrong with your configuration, for example.
  • In the documentation for Message Creators (“Dynamic Message Creation”), the MessageCreator/Field/InitialValue Xml element contains a simple replacement string: if the source file contains IDField_0, this will be replaced by the value generated by the configured MessageCreator. The documentation talks about this being a “field name“, which is not totally clear.
  • The MessageCreator/TemplateFilePath element should point to the configuration for the Message Creator, and not to the Template for document generation. It’s a bit mis-named.
  • If you have a Section for generating files, with a Message Creator within it, you have two references to the template file for your documents: in the Message Creator configuration file, the element MessageCreator/@SourceFilePath, and in the Section you have Section/SrcFilePath. This can get a bit confusing.

In my tests, I wanted to generate values with specific formats, so I decided to write an additional Message Creator. What I found out was that it was way quicker to disassemble the out-of-the-box CustomMC assembly and extend it than write one from scratch. Not exacly recommended and probably not supported/allowed, but… quick. I used Reflector.Net and the File Disassembler add-in.

LoadGen is a nice tool, but it’s only the beggining of your work. Now, what I would really like to see is something like this being used in conjunction with BizUnit :-).

Just another suggestion: Scott Colestock did a session at last year’s SOA conference I recommend, on this testing topic: %u00abApplying Maximum Sustainable Throughput to a Management/Operations Strategy%u00bb. Slides are here.

VMRCplus – Virtual Server cool WinForm based App now public!

If you’re like me and run a few virtual machines each day, then running them with
ease is key I reckon.

Generally I’ve found on dual core machines etc. virtual server makes better use of
multi-cpu based hosts than what Virtual PC2007 does (VMWare vs VPC is another debate
🙂

The only draw back is that I’ve always had to setup this IIS based website and it
gets painful, particularly on a laptop etc. when all sorts of things get installed
and uninstalled etc. IIS sites sometimes stop working and thus your only lifeline
to the running virtual machines.

Well VMRCplus is the answer! (This used to be an internal MS tool
which it looks like they’ve released to the public)

YOU DO NOT NEED IIS with this baby – it uses the COM Api behind the scenes.

Grab it here……..

VMRC
PLUS

Some features to wet your appetites:

    • Direct control of local or remote instances of the Virtual Server service. IIS and
      IE browser are no longer required!

    • Tabbed interface to quickly jump between Virtual Server hosts and guest VMRC sessions.

    • Reusable saved states: this feature allows users to preserve a particular saved state
      and return to that state at any time.

    • Multiple guest selection supported for startup/shutdown/save/display.

    • Browse button navigation for media, hard disk images, ISO images, .VMC files, etc.

    • Drag and Drop support for .VMC files, ISOs images, VHD and VFD files.

    • Resizable desktop support for guests running Virtual Machine Additions (maximize VMRC
      window supported).

    • Limited cut and paste of text from host to guest (only).

    • A built-in utility to take JPG screenshots of running guests. Useful when filing bugs.

    • Built-in error notification with Virtual Server eventlog viewer.

    • A Virtual Networks Manager and Virtual Disks Manager that cover all features.

    • Keyboard shortcuts (e.g. Ctrl-S to save state a guest).

    • Create multiple guests at once.

    • Create guest from parent (or multiple guests)!

    • Automatic reconnect to a designated Virtual Server host.

    • Toolbars in both Guest and Console Manager for quick access.

    • Unlimited number of guests.

    • Maximum of 32 Virtual Server hosts.

    • Sorting on columns of guests so you can sort based on status and multi-select.

    • Automatic detection of Virtual Machine Additions and notification.

    • Detection of Virtual Server 2005 R2 SP1.

VMRCplus – Virtual Server cool WinForm based Appnow public!

If you’re like me and run a few virtual machines each day, then running them with
ease is key I reckon.

Generally I’ve found on dual core machines etc. virtual server makes better use of
multi-cpu based hosts than what Virtual PC2007 does (VMWare vs VPC is another debate
🙂

The only draw back is that I’ve always had to setup this IIS based website and it
gets painful, particularly on a laptop etc. when all sorts of things get installed
and uninstalled etc. IIS sites sometimes stop working and thus your only lifeline
to the running virtual machines.

Well VMRCplus is the answer! (This used to be an internal MS tool
which it looks like they’ve released to the public)

YOU DO NOT NEED IIS with this baby – it uses the COM Api behind the scenes.

Grab it here……..

http://www.microsoft.com/downloads/details.aspx?fa…

Some features to wet your appetites:

    • Direct control of local or remote instances of the Virtual Server service. IIS and
      IE browser are no longer required!

    • Tabbed interface to quickly jump between Virtual Server hosts and guest VMRC sessions.

    • Reusable saved states: this feature allows users to preserve a particular saved state
      and return to that state at any time.

    • Multiple guest selection supported for startup/shutdown/save/display.

    • Browse button navigation for media, hard disk images, ISO images, .VMC files, etc.

    • Drag and Drop support for .VMC files, ISOs images, VHD and VFD files.

    • Resizable desktop support for guests running Virtual Machine Additions (maximize VMRC
      window supported).

    • Limited cut and paste of text from host to guest (only).

    • A built-in utility to take JPG screenshots of running guests. Useful when filing bugs.

    • Built-in error notification with Virtual Server eventlog viewer.

    • A Virtual Networks Manager and Virtual Disks Manager that cover all features.

    • Keyboard shortcuts (e.g. Ctrl-S to save state a guest).

    • Create multiple guests at once.

    • Create guest from parent (or multiple guests)!

    • Automatic reconnect to a designated Virtual Server host.

    • Toolbars in both Guest and Console Manager for quick access.

    • Unlimited number of guests.

    • Maximum of 32 Virtual Server hosts.

    • Sorting on columns of guests so you can sort based on status and multi-select.

    • Automatic detection of Virtual Machine Additions and notification.

    • Detection of Virtual Server 2005 R2 SP1.
baf:FolderName

baf:FolderName

The BizTalk Adapter Framework handles a lot of the configuration baggage for adapters
automatically using property grids and an annotated XSD schema provided by the
adapter management classes. Besides this, the framework allows the developer to customize
how a configuration property is edited in the property grid by including annotations
in the configuration XSD that inject custom type editors or custom type converters.

The Adapter Framework schema (BizTalkAdapterFramework.xsd [1]) also provides some
initial editors one can use by simply setting the type of the configuration element
to the correct value. One new type that appears to have been introduced in BizTalk
Server 2006 is baf:FolderName, which uses the standard Windows Folder Picker dialog
to select a file system directory. Pretty useful for properties that must reference
a folder name! Here’s how to use it:

<?xml version="1.0" encoding="utf-16"?> <xs:schema elementFormDefault="qualified" id="ReceiveLocation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:baf="BiztalkAdapterFramework.xsd"> <xs:import namespace="BiztalkAdapterFramework.xsd"
/> <xs:element name="Config"> <xs:complexType> <xs:sequence> ... <xs:element name="OutputDirectory" type="baf:FolderName"/> .. </xs:sequence> </xs:complexType> </xs:element> </xs:schema>

This seems like a good complement to the baf:FileName type that already existed in
BizTalk 2004, which used the WIndows File Open dialog.

[1] For the curious, this schema is embedded as a resource inside
the Microsoft.BizTalk.Adapter.Framework.dll assembly.

BizTalk is COM (or update to my post on Orchestration Performance)

BizTalk is COM (or update to my post on Orchestration Performance)

So I was answering a question on a internal (to Microsoft) email list I am lucky to
be on.  Someone asked a question about some code they were having trouble with 
– the code in question was being called from an Orchestration in BizTalk and they
were passing in the message as XmlDocument – converting that to an XmlValidatingReader
as a way of validating the document against their schema.

I pointed them to my
post on using XLANGMessage instead of XmlDocument
for performance.  This
actually seems to have solved their problem (even though I didn’t think it would –
I was just sort of morally opposed to creating an XmlDocument and then turning it
into an XmlReader when they could just go directly to an XmlReader – why do two steps
when one step would work?).

Tim Wieman (one of the BizTalk Rangers) pointed out to me that my code didn’t explain
something really important that my earlier post doesn’t mention (perhaps I should
edit that post as well now that I am writing this).  If you look at the docs
for XLANGMessage it
is pretty clear that when you are passing XLANGMessage to a .NET component – and you
just plan on reading it during your method call – you *should* call Dispose on it
before the end of your call.  This means you should always put the usage of XLANGMessage
inside of a try block and call Dispose in a finally block (as the above documentation
link clearly shows).  This was my bad – because of course I am generally thinking
about .NET and not about COM.  Well – BizTalk isn’t COM based – but XLANGMessage
is reference counted. 

After a discussion with Tim and Paul Ringseth (one of the orignal developers of XLANGs)
I came to accept this implementation.  Why did I reject it at first (I think
on the email thread I called it “stupid” ;-)?  Well – it just felt unnatural
to require *me* as the callee (the method implementor) be responsible for cleaning
up the XLANGMessage object passed in by the caller.

In most APIs – if you were passed an object and then called Dispose on it – you’d
be breaking the rules of your interaction with that API (one person I ran this by
said “I’d be really pissed if you Disposed of *my* object” – that would be Mark Taparauskas
– another really smart guy who doesn’t blog ;-)).

As Paul explained – the message doesn’t really belong to the .NET runtime – it belongs
to the MessageBox database – so it is similar to a COM interop scenario.  The
interesting thing is that the system is ref counted by the Orchestration instance
in this case – so if you fail to call dispose – the reference gets cleaned up at the
end of the Orchestration.  So depending on how long your Orchestration runs for
(if it is short) it isn’t a big deal.

But still –  the general rule of thumb is – if you are only using an XLANGMessage
instance during a method call – make sure to call Dispose on it during that method
call.

Brings
me back to the days when we used to have heated discusions about Refernce Couting
versus GC.  I guess those days are not completely gone yet – even in a .NET
product like BizTalk.

 



Check out my BizTalk
R2 Training.