Sunday, January 16, 2011

NServiceBus 3.0: Alternative Transports

Back in NSB 2.0 you could create your own transport but it took a bit of work.  In 3.0 the concept has been better abstracted to allow us to write custom transports more easily.  What was introduced was a new set of interfaces for us to implement:
These simple interfaces have been plugged into the transport layer and makes it pretty painless to derive a new transport.  In  NSB 3.0, we already have an FTP transport and an Azure transport.  I'm going to run through the FTP sample.  First things first, you have to setup a couple of FTP sites on your machine.  I followed the directions here.  To get the sample to work you have to set up one on port 1090 and one on port 1091.

Next we need to mod the config to match our local one, here is how my config looked for the Client:

Here is the config for the Server:


Now we can fire the whole thing up and start sending messages. Once a message is sent you can see it in your FTP directory.

Each is a file with the serialized data.  Its as simple as that!  It will be interesting to see what kind of other transports people plug in.  I'm hoping that there will be some other queue based transports like MQ Series.

1 comment:

  1. Hi,

    Excellent post, one question though:

    Does using the FTP transport mean that the messages are no longer transactional? I thought MSMQ was used as it supports transactions?