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.

About these ads

20 Responses to Releasing NServiceBus.Azure 5.0.0

  1. Tim says:

    Really nice update. However, I’m running into an issue. Whenever I try to deploy a simple worker role to Azure, I get Autofac.Core.DependencyResolutionException on the start up. Whenever (new NServiceBusRoleEntryPoint()).Start() gets executed, that error occurs. In EndpointConfiguration, I have just the normal Configure.With().DefaultBuilder(); and that is all. Any ideas? I even tried it without IWantCustomInitialization, but both methods result in the same error. Thanks!

    • Hi Tim,

      If an exception occurs in a constructor, it will be wrapped by the autofac infrastructure as a DependencyResolutionException. To get more details you’ll have to investigate the inner exception or look at the debug output for earlier exceptions.

      I’m happy to see that you got it resolved (I’m less happy that you don’t see from the exception what is wrong, but there is a github issue already to improve this experience)

  2. Tim says:

    By the way, it also is showing up if you try to deploy VideoStore.Sales on Azure. Apparently all of the rest work. I actually modeled my app (a small one) after the VideoStore.Sales app, so I’ll try modeling it off of the other apps and see if that works.

  3. Tim says:

    Yep, I modeled my app off of one of the other sample apps and it worked!!!!! Yay! I’m not sure what did it … I made a few changes, but nothing super obvious.

  4. Pingback: Tuesday, November 26, 2013 on #WindowsAzure | Alexandre Brisebois

  5. sam j says:

    I’m interested in the hybrid Azure Servicebus & MSMQ in a single nservicebus endpoint – where would I get started to figure out how to do this?

    Thanks – really appreciate your work to make the dll’s play nicely for those of us who use NServiceBus!

    Sam

    • Hi Sam,

      Currently NServiceBus only supports 1 transport per endpoint, so you will have to choose between msmq or azure servicebus.

      I’m interested to hear what your scenario is.

      • samjeffress says:

        I’m using an azure web role with servicebus as an external http api (this is a new addition to the product I’m building). All my internal services currently run on msmq – I want to retrieve the servicebus message through an existing handler and then forward it to a msmq queue for processing.

        Another way I have done it is to write a http api for my internal service (running in the same process) which does a bus.sendlocal to get the message onto msmq. Then I have a separate service which is running with azure servicebus transport and when it handles a message just sends it to the http api.

        I was hoping to cut the http api out of the picture and reduce the number of windows services I’ve got running.

        Does this make sense?

      • It does make sense, supporting multiple transports is on our long term feature list (not an easy one)… But I’m afraid that until then you will have to do with your HTTP API in between.

  6. Lars Hagrot says:

    I am trying to move an existing application using NServiceBus and MSMQ as transport to Azure using Azure Service Bus. Until now I have used the Video store sample as a blue print allocating one worker role per endpoint. That pattern will end up with a lot of cloud services and/or worker roles and will drive costs (lots of cores and instances).

    Now I am thinking about on how to cluster several endpoints in one Worker Role. What implications would there be in such a setup? And code changes? Have you thought about reconfiguring the Videostore sample using only one web role and one worker role?

    I am also looking for a complete description for NServiceBus specific azure parameter settings (keys and values) and advices for when to put them in app/web config and when to put them in cloud service configuration.

    • Hi Lars,

      NServiceBus comes with a dynamic host out of the box that does exactly what you want. The only ‘but’ here is that I haven’t come around to update the documentation and videostore sample for this scenario yet, but you can find the old documenation here, http://cloudshaper.wordpress.com/2011/09/25/hosting-options-for-nservicebus-on-azure-shared-hosting/

      As to guidance around where to put config settings… app.config and web.config usually, it’s bad practice to update config settings in production imo, so I see no point in doing this in the portal. There are exceptions obviously, but the majority of settings should simply go in config files and you retest & redeploy when they change

  7. Pingback: Windows Azure

  8. Pingback: Windows Azure Community News Roundup #78 - Windows Azure Blog

  9. Hi,

    I’m having some trouble with NServicebus on azure. Maybe you can spot where i’m going wrong.

    I’m getting the errormessage “System.InvalidOperationException: No handlers could be found for message type: TestMessages.TestMessage.” when i’m sending a message from a website.

    The steps I’ve taken:

    * I’ve created a regular asp.net mvc web site (to be hosted in azure websites), a regular azure worker and a messages project.
    * I’ve added nuget references to NServicebus.Azure, NServiceBus.Azure.Transports.WindowsAzureServiceBus. In the worker also to NServiceBus.Hosting.Azure

    * I’ve created a simple message (derrives from IMessage or ICommand).
    * In the worker, I’ve created a handler for the message, and in the website i’m sending the message.

    Then I get the message that tere is no handler found for the message type. When I create a handler in the website, it receives the message, but this is obviously not what i want.. the worker should handle the messages.

    I’ve setup the servicebus this way:

    startableBus = Configure.With()
    .DefaultBuilder()
    .TraceLogger()
    .UseTransport()
    .PurgeOnStartup(false)
    .UnicastBus()
    .CreateBus();

    And i’ve added the appropriate config to the web and worker role, such as:

    The funny thing is, if I start up the cloud video store, everything works fine, though I can’t see the difference between what I’m doing and what the cloud video store is doing.

    any pointers?

    thanks,
    Erwin

    • I suspect this is caused by assembly load failures. On startup nsb scans your assemblies for handlers and puts the types in memory, but if an assembly could not be loaded it will skip it. Can you check for Assembly or Type load exceptions in your debug output, to validate if this is happening?

      If that should not be the case, feel free to email me a repro on yves ad goeleven dot com

  10. Thijs Crombeen says:

    Hi Yves,

    Do you know when Nservicebus.Azure will be compatible with the latest version of WindowsAzure.Storage (3.0.2.0). When trying to update the nuget packages I get the following error: Unable to find versions of ‘NServiceBus.Azure, NServiceBus.Hosting.Azure, NServiceBus.Hosting.Azure.HostProcess’ that are compatible with ‘WindowsAzure.Storage 3.0.2.0′

    Thanks

  11. Pingback: 微软云计算: Windows Azure 中文博客

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: