Azure Storage Persistence Sample not working as outlined in the sample page


(Michael Mc Carthy) #1

I downloaded the “NServiceBus.Persistence.AzureStorage 1.x” version.

I ran the sample using Storage Emulator. The Subscription table is never populated, so the context.Publish(orderCompleted) line in the Timeout method of OrderSaga publishes, but the OrderCompletedHandler in the Client project never handles it.

Not too sure if this is a by-product of using the Emulator vs. real Azure Storage, or if I should be using the NServiceBus.Azure.6.x downloadable version?

Near the bottom of the doc, under “The Timeouts” section, it states:
“The sample is using Azure Storage Queues transport. From version 7.4 and above, the transport is using native delayed delivery and does not rely on the Azure Storage persistence for timeouts.”

Yet when I look at the package versions included in the download, the NServiceBus.Azure.Transports.WindowsAzureStrageQueues installed in the project is version 7.0.0. This means the delayed delivery should not be handled natively by the transport, but rather, be written to persistence and picked up when the timeout fires.


(Michael Mc Carthy) #2

it looks like adding:
routing.RegisterPublisher(typeof(OrderCompleted), “Samples.Azure.StoragePersistence.Server”);

to the Client’s Program.cs file picked up the subscription to the event, the OrderCompltedHandler was invoked and the Subscription table now contains the subscription to that event.

(Sean Feldman) #3

Hi Mike,

You’re correct.
Sample code has been updated for the 2.x version, but 1.x was left out.
I’ve updated the sample code for 1.x.

Thank you for bringing this to our attention.