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: «Applying Maximum Sustainable Throughput to a Management/Operations Strategy». Slides are here.