Speaking at NSBCon 2014 in London

I am thrilled to announce that I will be speaking at the very first NSBCon, which will be organised in London later this year in June, and has an impressive lineup of speakers. The topic that I’ll be covering will, obviously, be the relationship between the Microsoft Azure platform and NServiceBus.

NSBCon2014

NSBCon2014

For years now, I’m in the unique position to be both a contributor to NServiceBus and an early adopter of the Microsoft Azure platform. Furthermore I’m using this combination for my own startup project (www.messagehandler.net), so I have learned a few things about using NServiceBus on the Microsoft Azure platform.

In this session I will try to transfer some of my experiences to you, not only give you an introduction to the capabilities that the Microsoft Azure platform can bring to your NServiceBus solution, but also show what the differences are with traditional NServiceBus development and what you need to keep in mind.

To be more specific, we will dive deeper into the following topics:

  • What does it mean to run an nservicebus application in such a gigantic network as the azure platform? What are the benefits? What are the issues? And what can we do about those?
  • Which transports are available, and which ones are recommended, in this environment.
  • How about storage and hosting options?
  • And to wrap up, I’ll share some of my lessons learned for developing against azure ( pro tip: stop using the emulator! )

I’m also looking forward to (finally) meet many of you in real life that are actively using, or are interested in using, NServiceBus on Azure. I’ll definitly be hanging around in the hallways in between sessions talking to folks, so go register if you haven’t done so already and do not hesitate to grab me for a chat at the event!

See you there!

 

Releasing NServiceBus.Azure 5.0.0

Hi all,

I have published a new release of the Windows Azure support earlier today. This release is labeled 5.0.0 as it includes a few breaking changes, related to decoupling our binaries from the windows azure binaries that are distributed through VS (and not through nuget)

The first and probably most breaking change is the removal of the dependency to ServiceRuntime.dll, we will now lookup your version of the serviceruntime at runtime instead of at compile time. But because we had an inheritance dependency on one of it’s types in the past (through our RoleEnvironment class in NServiceBus.Hosting.Azure), we had to change the way this dependency works. So now we do composition over inheritance for the roleentrypoint as shown in the samples https://github.com/Particular/NServiceBus.Azure.Samples/blob/5.0.0/VideoStore.AzureServiceBus.Cloud/VideoStore.Sales/WorkerRole.cs

The second breaking change is that we removed our dependency on the WindowsAzure.Diagnostics.dll as well (as this is also distributed by the VS tooling). This forced us to remove the AzureDiagnostics configuration method, which configured diagnostics for you in the past. But as VS now also comes with a nice editing environment for the diagnostics settings, this functionality was not that usefull anymore so we removed it. Instead you should now configure diagnostics in VS itself and use .TraceLogger() instead.

The upside of both changes is that NServiceBus will now work irrespective of the Visual Studio tools your using (Either VS2012, VS2013, SDK 2.1, SDK 2.2 and future versions), so for a large part I hope we got rid of dll hell (Except for windows azure storage client, but that is another story)

Additionally, we also splitted the nuget packages for supporting azure services as transports and as persisters. Now there are 2 more packages that contain the transports

NServiceBus.Azure.Transports.WindowsAzureStorageQueues (Storage SDK 2.1.0.0)
NServiceBus.Azure.Transports.WindowsAzureServiceBus (ASB 2.2.0.0)

Which can be used indepently from the persisters, which are still in

NServiceBus.Azure (Storage SDK 2.1.0.0)

This change will make it a lot easier for hybrid scenarios where people only want to use windows azure servicebus for example with the regular on premises nservicebus.host.exe

I hope the upgrade will go smoothly for you, most changes should be in the azure cloudservice roleentrypoint, people using the transports on premises should not be impacted to much, besides a change in assembly and package references.

I have gone through the upgrade of the sample projects already, so when in doubt you can refer to https://github.com/particular/nservicebus.azure.samples/tree/5.0.0 for an example.

If you have further questions, do not hesitate to contact me.

MessageHandler – Early adopter program

Those of you who have been following me lately, know I’ve been working on a ‘Message processing as a service’ offering called MessageHandler and as MessageHandler is taking shape quickly, we decided to open it up for a few more early adopters.

As part of the Early Adopter Program, you’ll play a pivotal role in the validation of our service and it’s technology components. You’ll have access to the latest bits far before everyone else, giving you a strategic advantage over your competition. Furthermore you will also have the opportunity to provide suggestions to improve or even extend the capabilities before they’re released to the general public, giving you a say in how the final solution turns out.

So hurry up and subscribe for the early adopter program, seats are limited! You can sign up on http://www.messagehandler.net

Access Control Service – Why not to rely on the nameidentifier claim

Over the past week, while preparing http://www.goeleven.com/ for a migration to our production account on windows azure, I learned an important lesson that I would like to share with you, so that you don’t have to make the same mistake as I did.

The web front end, outsources authentication to various identity providers using the windows azure access control service. All of these identity providers provide a common claim that can be used to authenticate the user, being the nameidentifier claim. The value of the name identifier is unique for every user and each application. But in the scenario where there is a man in the middle, such as the access control service, this means that the value of the nameidentifier is actually unique per user per access control instance (as that is considered the application by the identity provider).

This prevents you from doing a certain number of operations with your access control service namespace as the value of the nameidentifier changes when you switch access control service instance, aka you loose your customers.

Things you can no longer provide are:

  • Migration of your namespace
  • Disaster recovery
  • High availability
  • Geographic proximity for travelling users

Therefore it’s better to correlate the user’s information with an identity on another claim, email address for example, which remains stable across different access control service instances.

The live id provider, does however not provide any additional information besides the nameidentifier, so I’m sad to report that I will have to stop supporting it!

And to make matters worse, I did not save any of the other claims. so now I have to go beg all of my users to help me upgrade their account :(

So if you are a user of http://www.goeleven.com/ , please help me update your account:

  • For LiveId users: Login with your account, navigate to profile > identities and associate any of the other providers.
  • For Non LiveId users: Just login with your account, this will automatically fix your identity.

Thanks in advance…

Launching Goeleven.com

First of all, let me wish you all a happy 2012!!!

Yes it’s new year’s day again, the day where everyone traditionally makes new and personal commitments for the next year. Almost for everyone these commitments are focussed on improving their personal life in one way or another.

I’ve also chosen this day to announce my latest project,  ‘Goe Leven’, as the intent of this project is very much the same as our personal commitments: Improve  personal life. You may not know this yet, but ‘Goe Leven’ is actually a Flemish sentence that means ‘living a good life’. And that’s just what I want you to do.

My mission is simple: Through an online platform I want to help you simplify the hectic life that you are leading today so that you have more time to enjoy it.

Over time, I will be releasing multiple services, apps and maybe even devices that are all intended for personal use for you and your family, at home, in the garden or on the go. And all of them will have the same goal, make day to day life simpler and give you some peace of mind.

Today, the first of these services is launching in preview. It’s an action management service that allows you to organize your daily chores and projects at home. I’ve  named, and based, the service on a methodology  called, ‘Getting Things Done’,  by David Allen. The method rests on the principle that a person needs to move tasks out of the mind by recording them externally, into a trusted system like ‘Goe Leven’. That way, the mind is freed from the job of remembering everything that needs to be done, and can concentrate on actually performing those tasks and gives you more time to be simply relaxed.

The platform is available as of now from http://www.goeleven.com and, if you’re interested, access to the private preview of the ‘Getting Things Done’ service can be requested in the store. I will onboard more people in small groups every week so that I can take the proper time to help you with any questions or issues that you may have.

Also, if you have an idea for additional services for personal use, or if you have a major personal topic on your mind that you think software could solve, let me know via the wishlist at http://goeleven.uservoice.com.

I hope that all of you may have a ‘Goe Leven’ as from now on :)

Video: Simplifying distributed application development with NServiceBus and the Windows Azure Platform

Yesterday I delivered a presentation to my fellow mvp’s on how NServiceBus and the Windows Azure Platform can be combined to simplify distributed application development in the cloud. The session has been recorded and is now available for everyone who is interested.

Enjoy (and sorry for my crappy presentation skills)

Hosting options for NServiceBus on Azure – Web roles & web workers

Understanding webroles

Up until now I’ve only discussed worker roles, deliberatly, as they are relatively straight forward to use in combination with NServiceBus.

Webroles however are a bit different when it comes to NServiceBus hosting, not that it is per se more difficult to do so, but you need to understand how webroles work to avoid weird effects when running NServiceBus inside them.

There are 2 flavors of webroles, Hosted Web Core and Full IIS, and it makes a difference to host NServiceBus depending on which one you use as their process model differs quite a lot.

Web roles models

If you’re webrole uses HWC there will be only 1 process hosting your assemblies, representing the web role. In this scenario there is no difference between a web and worker and you can simply host an NServiceBus endpoint inside of it the same way.

But in Full IIS mode, which is the default, you need to know that 1 webrole project will result in 2 processes which share the same assemblies. One of the processes is the role host, the other is an IIS website which will actually serve requests. But as they share assemblies, combined with the automagical nature of the NServiceBus hosting model, this would result in 2 processes with identical messagehandlers and configuration, not what you want.

Therefore we only support the hosting model for the role hosts (represented by webrole.cs in a webrole project). For the IIS website you have to configure the bus manually, using the Configure class and it’s extension methods.

Configuring a role manually has also been shown a lot in previous posts, but for completion sake I’ll show it again.

Configure.WithWeb() // With allows you to control the assemblies to load
    .Log4Net()
    .DefaultBuilder()
    .AzureConfigurationSource()
    .AzureMessageQueue()
            .JsonSerializer()
    .AzureSubcriptionStorage()
    .UnicastBus()
            .LoadMessageHandlers()
            .IsTransactional(true)
    .CreateBus()
    .Start();

Web workers

Now that you know that you can control the behavior of NServiceBus in both processes, you can create what we call ‘web workers’ in azure lingo. This are Windows Azure instances that host both webroles and worker roles. These are very interesting from a cost saving perspective, you can in fact host multiple website and workers when combining webworkers with NServiceBus’ dynamic azure host.

To set this up, you need to add a webrole.cs file to your webrole project in which you inherit from NServiceBus’ RoleEntryPoint and configure the endpoint AsA_Host. This will setup the role host to spin off child processes that act as workers, see my previous post on the details of how to do this. The host itself will not run a bus to avoid loading the website’s messagehandlers in it’s process space as these processes do share assemblies. (Remember! Selecting another role, like AsA_Worker, will load the messagehandlers)

In global.asax you can then configure the bus manually to be hosted in the website using the Configure class as stated above. All message handlers referenced from the webrole will be hosted in the IIS process and, as manual configuration ignores any IConfigureThisEndpoint implementation, you also avoid running a second dynamic host.

IIS 7.5

One small caveat when running in IIS version 7.5, which is installed on the latest azure OS families based on Windows Server 2008 R2, is that you cannot access either RoleEnvironment nor HttpContext early in the request lifecycle. Trying to configure NServiceBus at Application_Start will result in an exception as it does use these constructs internally.

An easy way to resolve this is to use .Net’s Lazy<T> to postpone initialization of the bus to the first Application_BeginRequest occurance in a thread safe manner:

private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus);

private static IBus ConfigureNServiceBus()
{
   var bus = Configure.WithWeb()
                  ...;

   return bus;
}

protected void Application_BeginRequest()
{
   Bus = StartBus.Value;
}

Want to get started with your own webworker?

Then check out the AzureHost sample in the NServiceBus trunk and build from there.

Happy coding!

Follow

Get every new post delivered to your Inbox.