I’m finally done with the code for WSMQ
Beta 2! Whew! If you’re not familiar with WSMQ, it’s a
simple, open queue application with a WSE 2.0 endpoint that is
easy to manage, deploy and scale. This latest
versoin represents a huge refactoring effort from the Beta 1
version. I’ve also added a bunch of new features.
Providers within Providers
One that I hope will allow it to be more useful is pluggable
data and queue providers. If you wish to customize the handling
of the queue operations, you can simply create a new QueueProvider,
drop into the application’s bin directory, configure it and
the Queue Web Service and Web Manager will use your
new provider. I’m going to release the source with two queue
providers, one for Xml (XmlQueueProvider) and one for Relational
Databases (DbQueueProvider). The DbProvider also uses an
additional provider model that will allow you to plugin db-specific
data providers (Oracle versus SQL). The SQL Server provider will
also be made available. I’m not expecting most to develop their
own Queue or Data providers, but for those who need to do this, I think this new
design will work well.
Message Trigger Plugins
The other, more generally useful new features I’ve added
are pluggable “Message Triggers” that you can upload to a queue,
through the WSMQ web manager. These triggers allow you to
embed custom code into a queue to handle certain queue events, such as
messages arriving on a queue or being recieved.
I ran into a host of issues with trying to design a good plugin
architecture. My final design involves spinning up a new
AppDomain for the message triggers, so that they can be easily loaded
and unloaded when a new trigger is uploaded, deleted or
re-versioned. I found a bunch of great resources on how to do
this, so I thought I’d post them here:
Eric Gunnerson’s AppDomains and Dynamic Loading is the place to start, as far as I can tell. Great overview and downloadable project.
CodeBetter’s good friend Roy Osherove has
a similar, but easier to swallow version of Eric’s example in
his series on adding plugins to your app. Add Plugins to Your App 2: Search dynamically for plugins without Config Files
And Suzanne Cook's .NET CLR Loader Notes are just awesome. Subscribed!
I’m hoping to have the installer, and source
code available for downloading early next week. I’ll try to
blog a bit about what I went through to get dynamic AppDomain
loading to work with ASP.NET, where things are a little different
from standard executables.
-Brendan