tag:blogger.com,1999:blog-2881242690839968442024-03-16T11:52:17.702-07:00On the BusAnonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.comBlogger56125tag:blogger.com,1999:blog-288124269083996844.post-84129608332976268572015-03-23T09:40:00.001-07:002015-03-23T09:40:21.862-07:00SQL and SSIS Deployment/Execution PowerShell ModulesWe've done a bunch of work to leverage PowerShell to completely automate our SQL Server and SSIS deployments. This includes the management of ISPAC and DACPAC packages respectively. I'd like to share this work with everyone at my blog repo, and specifically <a href="https://github.com/afyles/Blog/tree/master/SQLDeploy"><b><span style="color: magenta;">here</span></b></a>.<br />
<br />
I must note the overall approach is a DBA-centric one. The modules make heavy use of SSISDB and the other packaging executables. We did this instead of using the C# centric API. The largest problem with not using that API is that when things change, the modules will have to change. The trade-off is now we have something that can be expanded upon by savvy DBAs, which in my opinion is the audience for these modules. <br />
<br />
The modules can be had under the <a href="http://creativecommons.org/licenses/by-sa/4.0/">Attribution-ShareAlike Create Commons license</a>. Please let me know if you are having success with the modules. So now onto the good part, what's included?!?<br />
<br />
SqlDeploy.psm1 - a few common functions leverages by all the modules<br />
DacPacDeploy.psm1 - all things DACPAC. Includes drift reporting and creating sql scripts.<br />
IsPacDeploy.psm1 - all things ISPAC. Deploy, create environments, map variables etc.<br />
SSISPS.psm1 - this controls package execution.<br />
<br />
I hope these modules can help people out, send a comment if you find them useful!Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-80562724379452796162014-09-30T08:26:00.000-07:002014-09-30T08:26:46.486-07:00NSBCon NYC Slides: Beyond the POC<iframe src="//www.slideshare.net/slideshow/embed_code/39708080" width="476" height="400" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com7tag:blogger.com,1999:blog-288124269083996844.post-61105048808566956902013-06-03T06:11:00.000-07:002013-06-03T06:11:59.586-07:00DataBus CompressionWe have a requirement to be a bit conservative about our network traffic. We are using the DataBus to move larger data elements to distributed locations. My first attempt was to implement a transport message mutator to perform some compression, but it did not compress the DataBus properties.<br />
<br />
Come to find out, those are stripped after the file is written to disc, so the compression never hits. What I found to be the simplest thing to do is to just override the IDataBus/FileShareDataBus altogether. IDataBus has a couple of simple methods, Get and Put to override. I used the existing FileShareDataBus as a model and just injected some simple compression. Let's start with Put:<br />
<br />
<pre class="brush:c#">
public string Put(Stream stream, TimeSpan timeToBeReceived)
{
var key = GenerateKey(timeToBeReceived);
var filePath = Path.Combine(basePath, key);
Directory.CreateDirectory(Path.GetDirectoryName(filePath));
var outStream = new FileStream(filePath, FileMode.CreateNew);
using (var tinyStream = new GZipStream(outStream, CompressionMode.Compress))
{
var buffer = new byte[32 * 1024];
Int32 read = 0;
while ((read = stream.Read(buffer, 0, buffer.Length)) > 0)
{
tinyStream.Write(buffer, 0, read);
}
}
return key;
}
</pre>
<br />
Note that all I really did was slip in the GZipStream. Now for Get:
<pre class="brush:c#">
public Stream Get(String key)
{
var bigStreamOut = new MemoryStream();
using (var bigStream = new GZipStream(File.OpenRead(Path.Combine(this.basePath, key)), CompressionMode.Decompress))
{
bigStream.CopyTo(bigStreamOut);
}
bigStreamOut.Position = 0;
return bigStreamOut;
}
</pre>
<br />
Lastly all we need is a little bit of configuration magic:
<pre class="brush:c#">
public static class ConfigureCompressedFileShareDataBus
{
public static Configure CompressedFileShareDataBus(this Configure config, String basePath)
{
var bus = new CompressedFileShareDataBus(basePath);
config.Configurer.RegisterSingleton<IDataBus>(bus);
return config;
}
}
</pre>
<br />
Now we have a heck of a lot less data on the network...enjoy!Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-8353939718948242042013-02-21T07:51:00.000-08:002013-02-21T07:51:05.163-08:00NServiceBus Hands on Labs Please check out the<a href="http://nservicebus.com/Training.aspx"> new HOL on the NSB site</a>.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-28057997459948878512013-02-12T06:17:00.000-08:002013-02-12T06:17:02.973-08:00NSB Custom Fault Handling in 15 MinutesWe had a need to divert some of our exceptions over to a level 2 help desk. The help desk would then either fix the problem on behalf of the customer or initiate contact with the customer to fix the problem. We implemented a custom fault handler and it really only took 15 minutes. <br />
<br />
You must be aware that when you take control of the faults, it is up to you to handle all scenarios and in fact SLRs will not work. In our case, that doesn't really matter since the majority of our exceptions will be handled by a person with this new process. <br />
<br />
First we started out by adding some custom config to wire up the handler. We wanted to maintain the existing process for exceptions that the help desk would not handle, so we borrowed the code from the forwarding handler.<br />
<br />
<pre class="brush:c#">
public static Configure ForwardToHelpDeskInCaseOfFault(this Configure config)
{
....//left out for brevity
config.Configurer.ConfigureComponent<HelpDeskFaultHandler>(DependencyLifecycle.InstancePerCall)
.ConfigureProperty(fm => fm.ErrorQueue, ErrorQueue);
return config;
}
</pre>
<br />
Now we can just simply add that to our endpoint config.
<br />
<pre class="brush:c#">.ForwardToHelpDeskInCaseOfFault();
</pre>
<br />
Lastly, all we need to do is implement the interface and decide base on the exception where it should end up. With this, we are DONE!
<pre class="brush:c#">
public class HelpDeskFaultHandler : IManageMessageFailures
{
private Address localAddress;
private static readonly ILog Logger = LogManager.GetLogger("WebGateway.HelpDeskFaultHandler");
public Address ErrorQueue { get; set; }
public void Init(Address address)
{
this.localAddress = address;
}
public void ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e)
{
this.SendToHelpDesk(message, e, "ProcessingFailed");
}
public void SerializationFailedForMessage(TransportMessage message, Exception e)
{
this.SendToErrorQueue(message, e, "SerializationFailed");
}
private void SendToErrorQueue(TransportMessage message, Exception e, String reason)
{
...//left out for brevity
}
private void SendToHelpDesk(TransportMessage message, Exception e, String reason)
{
if ( e.GetType().IsAssignableFrom(typeof(MyCustomException)))
{
try
{
HelpDeskException hd = new HelpDeskException(message, e.Message);
hd.Save();
}
catch (Exception ex)
{
Logger.Warn("Failed to send to help desk, sending to error queue", ex);
this.SendToErrorQueue(message, e, "SendToHelpDeskFailed");
}
}
else
{
this.SendToErrorQueue(message, e, reason);
}
}
private void SetExceptionHeaders(TransportMessage message, Exception e, String reason)
{
...//left out for brevity
}
}
</pre>Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com1tag:blogger.com,1999:blog-288124269083996844.post-90397151345545946222012-12-17T05:43:00.001-08:002012-12-17T05:43:55.483-08:00NSB PowerShell Support in v3.3Looks like this is the answer to my request for granular control over infrastructure installation. This works for me as PowerShell is our common denominator for our developers and admins.
After getting through the new MSI installer, you will see a new short cut to a prompt.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRcQmLsNFSUR4xpiXFhMJlERwno1FketNQtolQZCcE8SotBgfXFLGp9IPxOTo96fxp5WJGqVhG4Vtd-v34SjfL5R5ul8QrM3jgErhT3tVIlzwSPrl1bntjvrXxqg6z_9ntT-VD1Dkj0mg/s1600/nsb_prompt.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="72" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRcQmLsNFSUR4xpiXFhMJlERwno1FketNQtolQZCcE8SotBgfXFLGp9IPxOTo96fxp5WJGqVhG4Vtd-v34SjfL5R5ul8QrM3jgErhT3tVIlzwSPrl1bntjvrXxqg6z_9ntT-VD1Dkj0mg/s320/nsb_prompt.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
I'm runing Windows 7 Enterprise and you will get an error OOTB</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOblTixv9nlRqgJKwWuX-cWPUIMsvrUqDy9r9CRFY35CFDWCO8abjO8_9XQDikC8w7IJOaQ2RgrFkkpb9sl4CnQQvZ64jeDpndpzDfPU5dmSsCYEDTyy1yAVJ6dSEDo0z92LK6-PIbQS8/s1600/nsb_prompt_error.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="336" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOblTixv9nlRqgJKwWuX-cWPUIMsvrUqDy9r9CRFY35CFDWCO8abjO8_9XQDikC8w7IJOaQ2RgrFkkpb9sl4CnQQvZ64jeDpndpzDfPU5dmSsCYEDTyy1yAVJ6dSEDo0z92LK6-PIbQS8/s400/nsb_prompt_error.PNG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
To get rid of this error you have to install PowerShell v3. I won't show examples of all the commands available, but we do now have full control over what is installed. Here is a listing of what is available:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Get-Message</div>
<div class="separator" style="clear: both; text-align: left;">
Get-NServiceBusVersion</div>
<div class="separator" style="clear: both; text-align: left;">
Install-Dtc</div>
<div class="separator" style="clear: both; text-align: left;">
Install-License</div>
<div class="separator" style="clear: both; text-align: left;">
Install-Msmq</div>
<div class="separator" style="clear: both; text-align: left;">
Install-PerformanceCounters</div>
<div class="separator" style="clear: both; text-align: left;">
Install-RavenDB</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I think all of these are pretty self explanatory. The great news is this takes care of allowing you to install only what you need instead of everything in the kitchen sink.</div>
<br />Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-55746959745782772632012-09-24T06:01:00.001-07:002012-09-24T06:01:52.166-07:00All I wanted was Perf CountersWe've been busy upgrading our endpoints and therefore there have been some reinstalls. NSB has some perf counters built-in to help you understand the relative health of your endpoint, (<a href="http://adamfyles.blogspot.com/2010/10/getting-started-with-nservicebus-part-7.html">you can add your own</a>). We still wanted those and therefore ran the Infrastructure installers. Then the fun started.
Much to our admins chagrin, MSMQ got re-installed along with RavenDB(which we don't use). Everyone got all grumpy so I went off into the code(3.2.6) to check and make sure we had everything straight. Here is the summary I gave to our admins:
Runmefirst.bat – this runs NServiceBus.Host.exe with the “/installInfrastructure” switch. This will install anything if it is not there or does not meet its requirements.
NServiceBus.Host.exe – when installing the windows service, you can also use the “/installInfrastructure” switch.
All OOTB profiles have “RunInfrastructureInstallers” = false. A custom profile can control this and be able to choose whether to run the install or not.
When it comes to perf counters, it used to be the case that on startup if they didn’t exist, they would be created. In v3, the installation stuff has been moved and will pick up anything that implements a given interface. I don’t see a way currently to pick and choose what gets installed OOTB.
So my advice would be to avoid running the infrastructure installers and we’ll just create a powershell script, or a custom profile, to isolate the perf counter install.
Here is a sample of the script(non-validated) that I gave them:
<blockquote>$pc = New-Object NServiceBus.Unicast.Monitoring.PerformanceCounterInstaller
$pc.Install([WindowsIdentity]::GetCurrent());</blockquote>
To follow up we <a href="https://github.com/NServiceBus/NServiceBus/issues/651">opened a issue to get granular control over installation of infrastructure</a> specifically.
Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-40711166809269044552012-08-29T10:18:00.002-07:002012-08-29T10:18:52.751-07:00Unobtrusive Mode - ASP.NET is Gonna Get-chaWe are using NSB as a send only endpoint in a REST style service hosted in ASP.NET. We are using unobtrusive mode and thought it would be easiest to identify our messages via using the assembly name itself. We unit tested fine, and our server side worked, but the client side just failed.
We forgot about the whole dynamic compilation thing in ASP.NET. So we had some choices we could either <a href="http://msdn.microsoft.com/en-us/library/bb398860.aspx">go with fixed names</a> or we could change our convention. We went with the latter. So be aware when you're dealing with ASP.NET.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-34431005385427387862012-07-11T12:32:00.001-07:002012-07-11T12:32:58.056-07:00Running 3.x Old SchoolI've run into a few interesting things that I thought I'd call out after running through an upgrade on my demo project. Here at work we want to run 3.x as we were running 2.x, but this takes some work. There are a couple of things you need to take care of.<br />
<br />
<h3>
NHibernate Persistence Requires Different Assemblies</h3>
<div>
In order to go back to NH persistence you need to pull in the NServiceBus.NHibernate package separately. You will also need to create your own profile that default to these settings.<br />
<br /></div>
<pre class="brush:c#"> public void ProfileActivated()
{
if (!Configure.Instance.Configurer.HasComponent<ISagaPersister>())
Configure.Instance.NHibernateSagaPersister();
if (!Configure.Instance.Configurer.HasComponent<IManageMessageFailures>())
Configure.Instance.MessageForwardingInCaseOfFault();
if (Configure.Instance.IsTimeoutManagerEnabled())
Configure.Instance.UseNHibernateTimeoutPersister();
if (Config is AsA_Publisher && !Configure.Instance.Configurer.HasComponent<ISubscriptionStorage>())
Configure.Instance.DBSubcriptionStorage();
}</pre>
<div>
<br />
<h3>
SLRs and Timeouts Creates Extra Queues</h3>
</div>
<div>
These features require extra queues that you didn't have in 2.x, so these need to be disabled via custom initialization.</div>
<pre class="brush:c#"> public void Init()
{
Configure.With()
.DefaultBuilder()
.XmlSerializer()
.DisableSecondLevelRetries()
.DisableTimeoutManager();
}</pre>
<div>
<br />
<h3>
Timeout Persistence Moved to the Database</h3>
</div>
<div>
There is no more MSMQ timeout persistence, so if you want this back, you'll need to implement it yourself. This should be as simple as going back into the code and copying out the code. </div>Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com2tag:blogger.com,1999:blog-288124269083996844.post-53069978544636992332012-04-12T11:19:00.000-07:002012-04-13T05:22:50.839-07:00NSB 3 Upgrade ContinuedI finally got back around to my demo solution. We run the Distributor as a stand-alone and would like to continue to so therefore I thought it would be good to validate that setup on 3.0. The configuration and setup is much improved since you don't need any special dlls anymore. The one thing you will run into is that when running in this mode, it is assumed that you will run the Distributor on another machine. This is fine, but you'll need a license and if you don't have one, you'll need to get a temporary one.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-18849057706703302832012-03-12T06:03:00.000-07:002012-03-12T06:03:21.729-07:00NServiceBus 3.0 UpgradesFor those upgrading to the 3.0 RTM, please check out <a href="http://www.nservicebus.com/UpgradingToNServiceBusV3.aspx">this video</a>. I've been upgrading my demo solution to check out the impact and so far all I've really had to do is name my endpoints and remove some config per the video. Thus far I've gotten my version of Full Duplex working along with basic Pub/Sub. Next I'll be hitting the Distributor since we use that pretty heavily. I'll be sure to post back any gotchas that I find.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-24942919998750706082012-01-12T05:54:00.000-08:002012-01-12T05:55:11.628-08:00JSON Serializer in NSB 3.0I was answering a question over on SO and I discovered that there is a JSON/BSON serializer built-in to 3.0. It seems like it would be possible with a a bit more digging that you could build upon my <a href="http://adamfyles.blogspot.com/2010/08/exposing-nservicebus-as-restwcf.html">hack to expose NSB as a REST endpoint</a> and skip the WCF serialization and jump right down into NSB(assuming WCF is configured to use the JSON format).Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com1tag:blogger.com,1999:blog-288124269083996844.post-69914923143833562162011-12-27T12:38:00.000-08:002012-01-12T05:55:24.881-08:00NServiceBus Modeling Tools ReviewAfter downloading and installing the package, the first thing that we have to do is create a new NSB application. So where is it? I expected it to be in a custom NServiceBus folder under Visual C#, but it wasn't. Then I tried Windows thinking that since we deploy as a Windows Service, it would be there. Nope. Modeling Projects? Nope. So then I did a search and found it at the Visual C# root. I eventually found it, but I'm hoping this moves somewhere more obvious. I'm also curious about the term "application". In the Advanced Distributed System Design course we talked at length on how an application is something that does not require network access, something like Microsoft Word. I'm thinking this should be changed to "System" instead.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGDPhD6wgaLxeEPNoV6G13zeR2FxzliS_0Nr0A5Cvy_USQb82dYgezGyeyukb_5YETNt3j0MTWp0uwPBi0WvbFDhLKp0FlsmoTlvqTpvuSBNuGMqzdC8ulNeHNDNm35TN1EcKR736PEs0/s1600/NewProjectPage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="441" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGDPhD6wgaLxeEPNoV6G13zeR2FxzliS_0Nr0A5Cvy_USQb82dYgezGyeyukb_5YETNt3j0MTWp0uwPBi0WvbFDhLKp0FlsmoTlvqTpvuSBNuGMqzdC8ulNeHNDNm35TN1EcKR736PEs0/s640/NewProjectPage.png" width="640" /></a></div>
It takes you right into the designer canvas which is nice. In the toolbox we have a pretty small set of items, a couple of message types, matching connectors, and two endpoints. I'm going to try to set up a simple send-only client that in turn publishes to a couple of subscribers.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSpmy1QzehYHEiKMI8R69GHez4qIRrBGxHUir4fY9Ic7qHauPE8_YIYrAB09O8LeEL04-dpYt2ykYPfbifGf1qCCLlBq-bqL0O3CRinjd7-Y2XmY8gClWyMILupMyDesaHyBvKIMXXJA0/s1600/pubsub2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSpmy1QzehYHEiKMI8R69GHez4qIRrBGxHUir4fY9Ic7qHauPE8_YIYrAB09O8LeEL04-dpYt2ykYPfbifGf1qCCLlBq-bqL0O3CRinjd7-Y2XmY8gClWyMILupMyDesaHyBvKIMXXJA0/s400/pubsub2.png" width="366" /></a></div>
Somehow my references are busted, so I opened the project to see the path and it's referencing some MSBuild variable, so I just updated all the refs. I'm not sure what the bug is here, but I'll blow right by it.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1LOLe2Eocw7c0C1ivr2a0vjIgVfFcAoUKs62aY1sO-_T8kZEgoB5u3ZHvKg6ZbZJBT4Fx-EEfI5tMjNUeBYNsbeZ6DaUhyHEUWPesTwxwJMnDQN3EI9jRnp8gqus72iKoWmMH1F5WSTc/s1600/BustedReferences.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1LOLe2Eocw7c0C1ivr2a0vjIgVfFcAoUKs62aY1sO-_T8kZEgoB5u3ZHvKg6ZbZJBT4Fx-EEfI5tMjNUeBYNsbeZ6DaUhyHEUWPesTwxwJMnDQN3EI9jRnp8gqus72iKoWmMH1F5WSTc/s400/BustedReferences.png" width="197" /></a></div>
Now that we've generated the system, let's go and see what it did. So far the Client looks just fine:
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKMGMsa7AwwTYdV7EwVPilfWUjv7d8nl5m2Let6aBalHuwogFo26oSYaMesIv12zM36uA4VQ43rcceYFTHfIWe6LOhIF3R4f2NbkK_fp1xi0i7IvLhVDc31ZDGcbsVRPlNqWnomnQ8kVg/s1600/client.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="116" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKMGMsa7AwwTYdV7EwVPilfWUjv7d8nl5m2Let6aBalHuwogFo26oSYaMesIv12zM36uA4VQ43rcceYFTHfIWe6LOhIF3R4f2NbkK_fp1xi0i7IvLhVDc31ZDGcbsVRPlNqWnomnQ8kVg/s400/client.png" width="400" /></a></div>
All the message classes look fine and I'm glad to see that the commands are separated from the events into different assemblies. I'm also glad to see that the Publisher is defined correctly:
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFgG7evdJfAOsF0cJOjzul7ycYvR2RiEOe2AB2FYY3IN6CAjPADbiCXt2f_VaN2F_LVyowrwwVDUwn59iD_d7wzbs7hV-IOhOPsdSWdLOZhyVKfJ27apObu9lBuP04S-4_A-8q8t-BG-Q/s1600/publisher.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="116" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFgG7evdJfAOsF0cJOjzul7ycYvR2RiEOe2AB2FYY3IN6CAjPADbiCXt2f_VaN2F_LVyowrwwVDUwn59iD_d7wzbs7hV-IOhOPsdSWdLOZhyVKfJ27apObu9lBuP04S-4_A-8q8t-BG-Q/s400/publisher.png" width="400" /></a></div>
I didn't think it would do that based on the canvas. I would like to see a larger group of endpoints that are defined based on there role. This would include Publisher, Subscriber, Distributor, Worker, and Server. This would make it very obvious to the beginner what they are building. The Subscribers are also defined correctly:
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0X1f-m1HGuUhMRIGBmmiQN2IleXc9unyZwW53r0sMq1Gx9E3wIckoi5BYEipt1BCWzov8zCWhC3Ftd0hwOb03HfWfWYIvWpNyWghgL7h0W1H2jHz9l3L_Di6x0QU7sc4h0Qpqi-mESkk/s1600/subscriber.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="118" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0X1f-m1HGuUhMRIGBmmiQN2IleXc9unyZwW53r0sMq1Gx9E3wIckoi5BYEipt1BCWzov8zCWhC3Ftd0hwOb03HfWfWYIvWpNyWghgL7h0W1H2jHz9l3L_Di6x0QU7sc4h0Qpqi-mESkk/s400/subscriber.png" width="400" /></a></div>
It would also be nice if the endpoint configuration matched what was on the canvas, in this case that would be "AsA_Subscriber". Most people that I've helped to learn NSB get a little caught up on what the endpoints can do. If we added "AsA_Subscriber" we could also do some validation on the subscription itself(depending on the profile).
All in all, this is a huge step forward. Congratulations to the team for significantly lowering the barrier to entry to getting started. I'd like to see some of the refinements I mentioned above and also would like some Distributor support(I'm sure that is on the list).Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-54942372494191150042011-12-20T14:18:00.001-08:002012-01-12T05:55:38.638-08:00NServiceBus 3.0 Beta 1You can download 3.0 from <a href="http://nservicebus.com/Downloads.aspx">here</a>Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-47256328147557454662011-10-31T06:05:00.000-07:002011-10-31T06:05:14.322-07:00NServiceBus Modeling Tools VideoI just gave this a look and the tools really lower the barrier to entry to "getting on the bus". I'm going to take some time this week and give it a full evaluation and I'll post that back here. For now, enjoy the video.<br />
<br />
<iframe src="http://player.vimeo.com/video/29659143?byline=0&portrait=0" width="400" height="225" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe><p><a href="http://vimeo.com/29659143">NServiceBus Modeling Tools for Visual Studio</a> from <a href="http://vimeo.com/user8685263">NServiceBus Ltd.</a> on <a href="http://vimeo.com">Vimeo</a>.</p>Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-6313419734473451972011-07-21T11:04:00.000-07:002011-07-21T11:04:15.037-07:00The Great Worker Pile Up Problem: Solved!<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL-ABuQwDg9WoKyyCYcRh2KkyWCks2EADNlIdKf4d8aE3tfywUrhTbUIZqksWuyuE-JxP7-OzKzvZsDBcHlv44-B5-eiBjGaA9lCGcq_8RKrr0U3qdYyA1Eu9S-ZKje8FC0XWdEilDsPQ/s1600/PileUp.jpg" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="216" width="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL-ABuQwDg9WoKyyCYcRh2KkyWCks2EADNlIdKf4d8aE3tfywUrhTbUIZqksWuyuE-JxP7-OzKzvZsDBcHlv44-B5-eiBjGaA9lCGcq_8RKrr0U3qdYyA1Eu9S-ZKje8FC0XWdEilDsPQ/s320/PileUp.jpg" /></a></div><br />
In our configuration of the Distributor pattern, we have the Distributor clustered across multiple VMs. We also run Workers on separate nodes in the same cluster. We are doing this so that we can deploy the same image to all nodes. With this configuration any Distributor/Worker can move from one node to the other in case of a failure. With all this sliding of nodes around we ran into one main issue.<br />
<br />
Everything worked great up until we had the big pile up. What would happen is we would intentionally drop all the nodes in succession until we got down to one node. Usually this node would have the Distributor already there and Worker1 would slide over. No problems. When Worker2 slid over to that node all of a sudden one of the Workers would take itself out of business, all the work would move to the other Worker and then we'd have a couple messages disappear. Disappear temporarily that is. Eventually they would come back and be processed. <br />
<br />
We initially thought this was due to MSDTC since we saw messages that weren't get ack'd hanging out. After chasing this awhile we then figured it must be some networking issue. Like just about any clustered VM we have 2 NICs configured on the VM, one for the SAN and one for everything else. Come to find out when the last Worker slid over, it was picking up the NIC for the SAN and not the general network. Therefore the messages weren't getting ack'd, but eventually they'd find their way back.<br />
<br />
We tried setting the priority of the NICs and so on to no avail. After speaking with MS, we ended up pinning the IPs of the local machines in the registry to the correct network interface. We also had to do this on the clustered services as well. Now when the nodes slide about the local IPs don't change and we have a script that the services depend on that updates the clustered IPs if necessary(like when you change data centers).<br />
<br />
I'd like to that our team for being persistent and finally tracking this one down. Now we can deploy the same image to all nodes and have them move about freely. Everything works as designed with full load balancing.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-24036898273269568752011-05-06T05:56:00.000-07:002011-05-06T05:56:17.963-07:00Introducing NServiceBus Visual Studio TemplatesI really got tired of creating the same projects over and over so I decided to create some templates. I packaged them up and put them on the Visual Studio Gallery: <a href="http://visualstudiogallery.msdn.microsoft.com/9546d382-7ffa-4fb8-8c0f-b7825d5fd085">http://visualstudiogallery.msdn.microsoft.com/9546d382-7ffa-4fb8-8c0f-b7825d5fd085</a><br />
<br />
Right now it only includes a few project templates and a few items. If you are using the project templates there is a custom wizard that will prompt you for a path to the NSB binaries. This will auto adjust the HintPath in the project file to point to that directory. <br />
<br />
I'm planning on adding more endpoints and some complete solutions in the near future. Let me know what you are looking for via the gallery so I can keep track of it there.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com8tag:blogger.com,1999:blog-288124269083996844.post-6281070903207138502011-04-27T11:06:00.000-07:002011-04-27T11:06:27.836-07:00More Reasons Working with NServiceBus is Just Easier than WCF over MSMQWe have some teams that went down the route of using WCF over MSMQ. Using a durable transport was the right thing to do for their process(accepting orders). We ran into a few issues along the way and had we used NSB to start with, we would have just avoided them.<br />
<br />
IIS/WAS Hosting<br />
<br />
We *thought* this would be a no brainer, but it really wasn't. Come to find out, if something goes wrong or your app pool recycles(every 24 hours or so guaranteed), you need to "warm-up" the service before it accepts messages. So Microsoft's answer to this is a warm-up extension to IIS or to host the service as a Windows Service. I think hosting in a Windows Service is a much better idea anyway as we weren't really using any of the IIS features anyway on the MSMQ transport. The thing is, had we used NSB out of the box we'd never have encountered such an issue.<br />
<br />
Windows Service Hosting<br />
<br />
Hosting this way gets you out of the warm-up jam. Unfortunately there is another problem if your shop uses SCOM like we do for monitoring. We haven't been able to get SCOM to monitor on the poison sub queues that WCF creates to put bad messages. We have some choices, which are call on MS to get this to work, build our own monitor, or just switch to NSB. I prefer the latter as we already have plenty of endpoints that we monitor just fine.<br />
<br />
Summary<br />
<br />
If you are thinking of using WCF over MSMQ make sure you host in a windows service and have a plan for when bad things happen. To us it makes sense to just retrofit those endpoints to NSB and avoid all the issues completely.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com4tag:blogger.com,1999:blog-288124269083996844.post-76631850268877051452011-04-06T16:56:00.000-07:002011-04-06T16:56:49.734-07:00NServiceBus Customization Part 2: IWantToRunAtStartupWhen NSB starts up it will look for all implementors of the interface IWantToRunAtStartup and call their Run() methods. When NSB spins down it will also call the Stop() method of the same interface. This gives us a good place to run expensive one time initialization code or to tweak out the bus prior to getting going. A common usage of this interface is for the manual subscription to specific message types:<br />
<pre class="brush:c#">public IBus Bus { get; set; }
#region IWantToRunAtStartup Members
public void Run()
{
this.Bus.Subscribe<IProductUpdatedEvent>();
this.Bus.Subscribe<IProductCreatedEvent>();
}
public void Stop()
{
this.Bus.Unsubscribe<IProductUpdatedEvent>();
this.Bus.Unsubscribe<IProductCreatedEvent>();
}
#endregion
</pre>One thing that I would caution against doing in the Run() method is not exiting the method. I've seen cases where someone will go into an infinite loop and never exit Run(). Typically this is done to perform a task on a given interval. There are much better ways to do this, mostly commonly you can put a Timer into the container and wire into its events. If you never leave the Run() method, the Bus doesn't ever really startup and you will get some odd results.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com2tag:blogger.com,1999:blog-288124269083996844.post-35125622754529824472011-04-01T05:48:00.000-07:002011-04-01T05:48:38.620-07:00NServiceBus 3.0 DetailsThe following content is paraphrased from the <a href="http://tech.dir.groups.yahoo.com/group/nservicebus/message/10357">Yahoo Group</a>:<br />
<br />
<br />
<div class="MsoNormal" style="clear: both; font-family: Georgia; font-size: 11pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 15px;"><b>First of all</b>, I'd like to talk about the thing that will influence you the most. We're making every effort to make the use of NServiceBus (particularly it's auxiliary processes like the Timeout Manager, Distributor, and Gateway) much, much easier. What this means is removing much of complexity of using these capabilities by hosting them within the same host as your own process, but don't worry, we'll make it easy for you to turn them on and off using profiles. This will enable us to configure all the routing to these processes for you, but if you want, you can always go back to the manual approach in version 2.x. This is where I'll be investing most of my time.<o></o></div><div class="MsoNormal" style="clear: both; font-family: Georgia; font-size: 11pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 15px;"><o> </o><b>Second</b>, there's the Data Bus feature that Andreas Öhlund (<a href="http://andreasohlund.net/" style="color: blue; text-decoration: underline;">http://andreasohlund.net/</a>) has been working on. As many of you know, most queuing transports have a limit on the size of message they can deliver - with MSMQ this is 4MB, with Azure it's 8KB. The Data Bus will allow you to transmit messages of an almost arbitrary size as it transmits the "data" portion on a separate infrastructure than the actual message. This is currently implemented using the file system but will be done using a database (RavenDB) as well - more on that in just a minute. The thing is that between remote sites, there often isn't the ability to have a shared file system or database, as the sites may not always be connected to each other. In order to resolve this issue, Andreas is also working on the Gateway to make it Data Bus aware - that and also able to support transports other than HTTP, like TCP and FTP.</div><div class="MsoNormal" style="clear: both; font-family: Georgia; font-size: 11pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 15px;"><o></o></div><div class="MsoNormal" style="clear: both; font-family: Georgia; font-size: 11pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 15px;"><o> </o><b>Third</b>, there's the Azure integration that Yves Goeleven has been driving for some time now. For all those of you who've been looking for a simpler developer experience on Azure, Yves has really done it, abstracting away almost all of the underlying complexity behind your standard NServiceBus interfaces. You can find out more about this through his series of blog posts here:<a href="http://cloudshaper.wordpress.com/" style="color: blue; text-decoration: underline;">http://cloudshaper.wordpress.com/</a></div><br />
<br />
<div class="MsoNormal" style="clear: both; font-family: Georgia; font-size: 11pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 15px;"><b>Fourth</b> is RavenDB integration. I'm happy to say that a licensing agreement has been reached that will allow users of NServiceBus Standard Edition to use RavenDB for things like Subscription Storage and Saga Persistence at no additional cost. This will save you from having to haggle with your DBAs anytime you want production-ready storage for NServiceBus - it'll give you a much more cohesive deployment without worrying about overloading your existing relational databases. I'm happy to welcome one of our newest committers, Jonathan Matheus (<a href="http://www.linkedin.com/in/jonathanmatheus" style="color: blue; text-decoration: underline;">http://www.linkedin.com/in/jonathanmatheus</a>), who is making this happen.<o></o></div><div class="MsoNormal" style="clear: both; font-family: Georgia; font-size: 11pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 15px;"><o> </o>The integration of RavenDB will enable us to stop merging NHibernate, but we'll still integrate with it out of the box. This will make it much easier for you to plug in your own version of NH instead of ours.</div><div class="MsoNormal" style="clear: both; font-family: Georgia; font-size: 11pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 15px;"><o></o></div><div class="MsoNormal" style="clear: both; font-family: Georgia; font-size: 11pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 15px;"><o> </o><b>Fifth</b> is the Timeout Manager - one of the areas of NServiceBus that hasn't been as strong as the others. Jonathan Oliver (<a href="http://blog.jonathanoliver.com/" style="color: blue; text-decoration: underline;">http://blog.jonathanoliver.com/</a> who has been ramping up his involvement over the past while) will be using our new RavenDB persistence to replace the use the input queue, which will dramatically increase the performance and robustness of the Timeout Manager.</div><br />
<br />
<div class="MsoNormal" style="clear: both; font-family: Georgia; font-size: 11pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 15px;">We're also looking at stronger Visual Studio integration, possibly to the level of providing model-driven code/config generation. We'll see if it's feasible to get that done within the 3.0 timeframe, or whether that will be delivered as a separate download afterwards.<o></o></div><div class="MsoNormal" style="clear: both; font-family: Georgia; font-size: 11pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 15px;"><o> </o>Finally, the <b>3.0 release schedule</b> looks something like this - Alpha by the end of April (primarily focusing on APIs), Beta in July, and a Release (or at least release candidate you can go live with) in September.</div>Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com3tag:blogger.com,1999:blog-288124269083996844.post-41535068221407995962011-03-27T11:59:00.000-07:002011-03-29T05:22:32.384-07:00NServiceBus Customization Part 1: IWantCustomInitializationIn this first part we're going to explore how to take control of NServiceBus during the initialization phase. By implementing the IWantCustomInitialization interface, you take full control away from NSB Roles. What is a Role? A Role tells an Endpoint how to participate on the bus. Typical Roles are the Server, Client, and Publisher Roles. These are defined by a class in your project, typically named EndpointConfig. A Role will define certain aspects of behavior, like whether or not it can receive messages(AsA_Client). <br />
<br />
Most of the time you don't end up ever overriding the default behavior of the Roles. When you do, you'll implement the IWantCustomInitialization interface and have full control over NServiceBus. You will use the static NServiceBus.Configure class to get things going. Let's take a look at all the options(as of 2.5, 3.0 follows):<br />
<br />
<ul><li><b>.With()/.WithWeb()</b> - these first methods give you the ability to control assembly scanning. When NSB fires up, it will scan the bin directory by default. This gives you control over what gets scanned. You can provide a list of Assemblies, a list of Types, or a path. You'll want to use the WithWeb() version if you are using NSB with ASP.NET. </li>
<ul><li><b>NServiceBus.AllAssemblies</b> - This class allows you to provide a list of assemblies not to load. An example of this would be "AllAssemblies.Except( "Assembly1" ).And("Assembly2")". </li>
</ul><li><b>.Synchronization()</b> - tells NSB that message processing with occur in a synchronization domain. This is useful for rich client applications where you need to marshal from a background thread back to the UI.</li>
<li><b>.DefaultBuilder()</b> or <b>.MyContainerOfChoiceBuilder()</b> - this next set of methods controls the container. You can take the default container(AutoFac as of 2.5) or specify your own. You'll need to include the builder implementation for your container as well as specify an instance of your container. </li>
<li><b>.UnicastBus()</b> - use unicast messaging</li>
<ul><li><b>DoNotAutoSubscribe()</b> - do not auto subscribe to a Publisher's messages</li>
<li><b>ForwardReceivedMessagesTo( String )</b> - forward all messages to another endpoint. This is helpful if you want to do some auditing.</li>
<li><b>LoadMessageHandlers()</b> - tells the bus to scan and load message handlers. There are a couple interesting variants on this method:</li>
<ul><li><b>LoadMessageHandlers<TFirst></b> - tells the bus to load the handlers but load the assembly where TFirst resides before the rest</li>
<li><b>LoadMessageHandlers<T>( First<T> )</b> - load the handlers and specifies that the handlers in the given order should go first. To use the First class to specify ordering, it has 2 methods, "Then" and "AndThen". A typical usages would be "First<IHandler1>.Then<IHandler2>().AndThen<IHandler3>()"</li>
<li><b>PropagateReturnAddressOnSend( Boolean )</b> - receivers of the messages sent by this endpoint will see the address of the incoming messages</li>
</ul></ul><li><b>.XmlSerializer()</b> or <b>.BinarySerializer()</b> - specify the serialization technique you'd like to use.</li>
<li><b>.CustomConfigurationSource( IConfigurationSource source )</b> - if you would rather not use the standard app.config file or its sections for Administrative configuration, you are welcome to use your own. Simply implement the IConfigurationSource interface and you are on your way.</li>
<li><b>.MsmqTransport()</b> - tells NSB to use MSMQ as the underlying communication mechanism. This may be swapped out in favor of other transports. Along with this setting, you can configure a few things underneath it:</li>
<ul><li><b>.DoNotCreateQueues()</b> - don't try to create queues if they don't exist</li>
<li><b>.IsolationLevel( IsolationLevel )</b> - the isolation level of the transaction that MSMQ uses. You may consider tweaking this for performance reasons or otherwise.</li>
<li><b>.IsTransactional( Boolean )</b> - for web scenarios, you may not want to use a transaction when pushing a message to the queue</li>
<li><b>.PurgeOnStartup( Boolean )</b> - determine whether or not to purge queues when NSB starts up.</li>
<li><b>.TransactionTimeout( Timespan )</b> - the time to wait for a transaction</li>
</ul><li><b>.MsmqSubscriptionStorage()</b> or <b>DBSubscriptionStorage()</b> - tells NSB where to persist subscriptions. If you are using Profiles, this is set in the Profile of choice(Lite, Integration, or Production). If using MSMQ, the queue to use is in the config file. If using NHibernate, you can default to the config file for NH properties or supply an IDictionary to the overload.</li>
<ul><li><b>.DBSubscriptionStorageWithSQLLiteAndAutomaticSchemaGeneration()</b> - pretty sure we all have this one down.</li>
</ul><li><b>.Sagas()</b> - tells NSB to look for Sagas in the assemblies provided to NSB in the beginning of the process.</li>
<li><b>.NHibernateSagaPersister()</b> - this will use NH for Saga persistence. Unless supplied to the overload, NSB will use the config file for the NH properties. You can give this method an IDictionary of properties as this point. </li>
<ul><li><b>NHibernateSagaPersisterWithSQLLiteAndAutomaticSchemaGeneration()</b> - pretty self explanatory I think.</li>
</ul><li><b>.RijdaelEncryptionService()</b> - if you are encrypting messages, this will load the keys from the config.</li>
<li><b>.Log4Net()</b> - there are a few overloads here for you to tweak Log4Net. You have access to the Appender, AppenderSkeleton, and you and specify your own configuration.</li>
<li><b>.RunCustomAction( Action )</b> - this is a place where you can run anything you want really. Typically I've seen this used to tweak the container very early in the boot strapping process.</li>
</ul><div><b>New 3.0 Options</b></div><div><b> </b>Some of the options have moved around to new classes, but the semantics remain the same. Below are some of the new options available to address new features.</div><div><ul><li><b>.MessageForwardingInCaseOfFault()</b> - tells the bus to forward messages when there is a fault</li>
<li><b>.FtpTransport()</b> - FTP transport options</li>
<li><b>.ImpersonateSender(Boolean)</b> - whether we should impersonate the sender or not</li>
<li><b>.InMemoryFaultManagement()</b> - sets up the in memory fault manager. Faults are lost when the process shuts down.</li>
<li><b>.NHibernateFaultManager()</b> - sets up the NH fault manager. Faults are saved to a database with the exception that caused them.</li>
<li><b>.NHibernateUnitOfWork()</b> - sets the UOW manager to use the internal NSB NH manager. You can supply your own if you are also using NH in your code.</li>
</ul></div><div>As we've found out, you have full control over how NSB is configured right from the start. Next time we'll a close look at the Roles we talked about earlier in the article.</div>Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com3tag:blogger.com,1999:blog-288124269083996844.post-58433188039252397732011-03-21T11:56:00.000-07:002011-03-21T11:56:37.160-07:00ReturnToSourceQueue PowerShell Script: UpdatedUPDATE: I've added transaction support to the script. Previous to this you would have lost a message if something had gone wrong. PS does not support TransactionScope, so we had to use MessageQueueTransaction.<br />
<br />
The ReturnToSourceQueue.exe tool that comes with NSB presented a challenge to us when we tried to deploy it on all our app servers. We needed to schedule an on-demand job to run the tool by our Operations group. Since the agent we use goes on each machine and is not cluster aware, this presented an issue. Our resolution was to replicate the same functionality in PS with a bit of a twist. We added the ability to hit a remote queue. The script was done by one of our developers Brandon Moriarty and I've <a href="https://github.com/afyles/Blog/blob/master/PowerShell/ReturnToSourceQueue.ps1">posted it to GitHub</a> for everyone to enjoy! Big thanks to Brandon for whipping this one up. Don't forget I have a few other PS scripts in there to do some quick and dirty things with MSMQ.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com1tag:blogger.com,1999:blog-288124269083996844.post-45446954095165469432011-03-18T07:44:00.000-07:002011-03-18T07:44:08.034-07:00NServiceBus Customization, Let me Count the Ways!So as promised I'm going to start a new series on customizing the behaviour of NSB. I figured that we'd first try to count up all the ways to do it and then tackle each one by one. I'm going to categorize them by when they occur during the NSB lifetime, Startup, Processing, and Shutdown. I'm not going to include everything(it would take forever), but I'm going to include the most popular places where you'd customize.<br />
<br />
<b>Startup</b><br />
<br />
<ul><li>IWantCustomInitialization - take over control of how the bus is initialized, skipping Roles</li>
<li>Roles - AsA_* interfaces. Control how the bus is initialized.</li>
<li>IWantToRunAtStartup - run a custom action once at startup</li>
<li>IConfigureLoggingForProfile<T> - configure logging for a specific Profile</li>
<li>Profiles - IProfile. Determine settings for a given target environment. OOTB includes "Lite", "Integration", and "Production"</li>
<li>ISpecifyMessageOrderHandling - creates a "pipeline" of messages and gives them a specific order</li>
<li>The Container - you can pretty much change anything in the container, including passing in your own that is loaded with your stuff.</li>
</ul><br />
<b>Processing</b><br />
<br />
<ul><li>IMessageMutator - manipulate inbound and outbound messages</li>
<li>IMessageModule - inject some logic before and after message processing</li>
<li>IManageUnitsOfWork - UOW pattern handling</li>
<li>IManageMessageFailures - custom failed message handling</li>
<li>Processing Events - StartedMessageProcessing, TransportMessageReceived, FinishedMessageProcessing, FailedMessageProcessing. You can use these to do something when message events are happening(say perf counters)</li>
</ul><b><br />
</b><br />
<b>Shutdown</b><br />
<br />
<ul><li>IWantToRunAtStartup - there is a Stop method here that gets called once during shutdown</li>
</ul>Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0tag:blogger.com,1999:blog-288124269083996844.post-16304786242951876202011-03-18T05:24:00.000-07:002011-03-18T05:24:56.520-07:00ReturnToSourceQueue PowerShell ScriptThe ReturnToSourceQueue.exe tool that comes with NSB presented a challenge to us when we tried to deploy it on all our app servers. We needed to schedule an on-demand job to run the tool by our Operations group. Since the agent we use goes on each machine and is not cluster aware, this presented an issue. Our resolution was to replicate the same functionality in PS with a bit of a twist. We added the ability to hit a remote queue. The script was done by one of our developers Brandon Moriarty and I've <a href="https://github.com/afyles/Blog/blob/master/PowerShell/ReturnToSourceQueue.ps1">posted it to GitHub</a> for everyone to enjoy! Big thanks to Brandon for whipping this one up. Don't forget I have a few other PS scripts in there to do some quick and dirty things with MSMQ.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com3tag:blogger.com,1999:blog-288124269083996844.post-39512883303502370682011-03-07T14:11:00.001-08:002011-03-07T14:12:13.498-08:00Oracle AQS Transport Now on NServiceBus-ContribSource has been committed to the<a href="https://github.com/nservicebus/nservicebus-contrib"> v2.5 branch on GitHub</a>. I'll start work on the master(a.k.a. 3.0 version) shortly.Anonymoushttp://www.blogger.com/profile/04954291460807548462noreply@blogger.com0