RSS

Azure Service Bus Notification Hub for iOS + Bonus Xamarin Binding!

Recently I’ve been working with Edwin van Wijk on the brand new Azure Service Bus Notification Hub by Microsoft. It’s a unified messaging hub for delivering push notifications to mobile devices. The current iteration supports Windows Store and iOS apps.

The service is quite nice, and is a cloud based contenter to products like PushSharp. You won’t need custom hosts for the integration, which is a benefit over PushSharp and the likes. However, in its current (Preview) version, it doesn’t support nearly as many platforms as PushSharp.

The Notification Hub builds upon the Azure Service Bus infrastructure for relaying messages in a massively scalable way. This means that it also leverages Service Bus’s topics and subscriptions feature for easily grouping messages using Tags. A nice way to filter messages and distinguish groups.

Edwin and I did a session on this. You can find the slides here. The slides are in Dutch by the way.

For iOS, Microsoft has released a native Objective-C library. There’s a tutorial on MSDN that nicely describes the steps you need to take to consume the library in XCode.

In order to test it, you’ll need to set up quite a lot of prerequisites, including a Windows Azure Service Bus instance, a Notification Hub, Apple AppID and an APNS certificate. A bit finicky to set up, but once it runs, it works nicely.

Xamarin binding
It’s quite logical for Microsoft to release an Objective-C library at first, especially in the current Preview stage of the product. Still, I felt a bit dissatisfied having to write my app in Objective-C. I have been wanting to experiment a bit more with creating a C# binding to Objective-C libraries, so I’ve decided to make one available for this library.

I have a working version up on GitHub, which includes a sample. It’s based on the latest API version – you’ll need a Notification Hub created after April 2013 for it to work. You’ll also need to setup your own certificates and fill in the Service Bus namespace, Notification Hub name and Shared Access Secret Listen key.

Basically, you’ll use the library in the RegisteredForRemoteNotifications method on your AppDelegate class. I have a write-up on that in an older blogpost here.

The current binding is a basic one. Completion handlers are mapped to delegates, and I think some of the type mappings could be more C# friendly. I’d also like to make it async/await friendly but I’ll have to experiment with that a bit more.

I’d love to hear your feedback on this!

 
Leave a comment

Posted by on 23 May 2013 in Apple, Info Support, Work, Xamarin

 

Slides and demo code for our 80% code share talk

Marcel and I have crafted a blogpost with slides and demo code for our 80% Code Share session at the Xamarin Evolve 2013 conference.

The post can be found here on Marcel’s blog.

We tremendously enjoyed the Evolve conference, delivering our sessions, and the response we got afterwards.

We’d love to know your feedback on this!

 

Tags: ,

Xamarin Evolve 2013 – Day 4

And so, Evolve 2013 has come to an end. Time flies when you’re having fun. This was day 4 for us in Austin. Four days of Xamarin mobile goodness.

This was another interesting day. It started off with a session by Josh Clark from Global Moxie, and author of Tapworthy on user interface design and touch. While his message – have users directly interact with content instead of indirections, such as buttons – wasn’t revolutionary, he had a couple of nice and inspiring examples to show us. Apps that have implemented some innovative UI’s. A nice session to start the day with.

Oh, and he had a picture of an OCD Chef’s cutting board… man I gotta have this in my kitchen :)

LOL, I want this in my kitchen! #xamarin

After that, I went to Marek Safar‘s session on Using Async in Mobile Apps. He shared some good tips and pointed out some pitfalls around SynchronizationContext when using Async.

Most of the day was spent in the hallways of the Hilton though, talking to people, meeting all the faces I have in my Twitter stream in person. This was awesome. Great to share a passion for mobile development with Xamarin and talk face to face about our experiences. Thanks Greg, John, Wally, Ben, Nic, Stuart, Miguel, Nat and all those I forgot to mention for catching up.

Of course, Marcel (@marcelv) and I did our own session titled “Sharing 80% of Code on iOS, Android and Windows Phone”. We decided to give our own take on code sharing, and how to achieve this in a low barrier, simple way. We spent a lot of time during the conference, speaking to developers with all different levels of coding skills and we found that a lot of them were impressed by some of the frameworks and approaches that were being presented for achieving code reuse, but for whom all of this went a bit over their head. These frameworks tend to hide a lot of clever tricks, and you also run the risk of over-abstracting. So we took our lessons learned from a real life example app we built for a customer, and explained some small but clever architecture and coding tricks.

We got great response afterwards, and got some requests for sharing some of our code. Marcel and I will be working on a blogpost, showing all of the constructs we presented today. Have an eye out for Marcel’s blog. We’ll put it up there and I’ll cross post it here as well.

I visited Nic Wise‘s session about MonoTouch.Dialog as well. It’s tough to be the last session of the day, but he did a good job. I’m not entirely convinced that MonoTouch.Dialog is a solution in every scenario, but it does provide a neat way to quickly code up an iOS UI.

So after that, it was time for the closing keynote already… Nat and Miguel announced Evolve 2014, and in order to show their commitment, five lucky birds in the audience won a ticket. Awesome, can’t wait for the next installment of this awesome conference.

#Xamarin Evolve 2013 is a wrap!

In closing, I’d just like to give my compliments to the whole Xamarin staff and the production company for putting together an inspiring conference. I loved the attention to detail that was visible everywhere. I enjoyed the vibe, the great food, and the fantastic content.

See ya’ll next year!

 
 

Tags: ,

Xamarin Evolve 2013 – Day 3

Day 3! Or actually Day 1 of the Evolve conference, to be exact. And whew what a day!

Of course the conference kicked off with the keynote by Nat and Miguel. What a well produced and slick show! A big stage, with gorgeous graphics on the big projector screens, awesome. You should definitely check out the video of the keynote here. We were proud to see Info Support there as Silver Sponsor:

Does this look awesome or what? @InfoSupportBV sponsor booth at #Xamarin Evolve! :-)Let's go! #xamarin

Xamarin blew everyone away with a couple of great product announcements today. Only six weeks after releasing Xamarin 2.0, four major new features were announced:

C# 5.0 async/await
This C# compiler feature enables much cleaner syntax for async programming, resulting in better readable and shorter code. Moreover, less chance of bugs due to event handlers dangling around. Async/await was announced by Xamarin a short time ago as a beta, but available as of today in a final version.

F#
For those who like functional programming, F# is now a first class citizen in the Xamarin stack as well. I’m still new to F# but I’ll definitely check it out. A nice addition.

But the biggest features, that got the whole audience exploding were…

iOS User Interface Designer
WOW! This was some rabbit Miguel pulled out of his hat. An iOS UI designer embedded in Xamarin Studio, to replace having to resort to XCode’s Interface Builder. And it does not only replace it very well, but goes way beyond what IB does. Besides looking gorgeous, the designer tightly integrates with the code generator in Xamarin Studio. Adding controls to a view automatically adds member variables to the class. Actually they’re still outlets, but you won’t have to worry about them. So dragging lines from UI elements to Objective-C code files is over. I used to get so many smirks from Visual Studio developers when I demo Xamarin / XCode integration in my talks. This is all over now. No more explaining what an outlet is, because… as Miguel mentioned in his talk:

I am glad though, that Xamarin stayed closed to the Apple structure when it comes to the generated code. As far as I can see, the designer generates code that is compatible with code coming from the XCode integration. Controls are still marked with an [Outlet] attributes, etc. I have yet to try the designer myself, but I assume that XIB files and storyboards are instantly usable with the Xamarin designer.

Furthermore, any UI component that you might have in your solution, be it from the Xamarin Component Store, from a referenced DLL or self coded in your project, automatically becomes available in the designer. And what’s more, it shows a live preview of the control at design time!

I really didn’t expect this designer to be available so soon. I had seen screenshots and ideas from Miguel but I thought that it was still some time away from becoming a real product.

Again, kudos to the Xamarin team!

Like Miguel mentioned… If you ever think “Xamarin should do UMMM…”

Xamarin Test Cloud
Again, WOW! After the iOS designer, people weren’t expecting any more stuff. But then Nat came on and introduced the Xamarin Test Cloud. A fantastic new product that does automatic UI testing for virtually every smart phone or tablet device available on the market. Xamarin actually acquired LessPainful solutions for their infrastructure. Basically, Test Cloud is a test service that uses real, physical devices to run UI tests on, based on exploratory testing (i.e. hitting every feature in the app) or a prerecorded test script, expressed in Given, When, Then construct.

Here’s Xamarin’s own introduction page on Test Cloud: link

TechCrunch has written a nice introduction article on this as well.

So that was a shocker for the audience. Awesome. This is a major step for Xamarin though. With this completeness of vision, I think Xamarin will win over a lot of customers that were reluctant to come along with the Xamarin tools. Customers, at least the ones we’re servicing, were a bit reluctant about the maturity and completeness of the holistic vision and approach of mobile development. I think today, Xamarin nailed that question!

The sessions following after that were mostly good. I enjoyed Stuart Lodge’s session on MvvmCross, Sebastien Pouliot’s session on Advanced Build Mechanics for iOS and of course Scott Hanselman’s session, which was basically a nice celebration of the C# language.

And of course I enjoyed doing our own talk about creating a uniform login experience across devices. We’ll put the accompanying slides and source code online as soon as we have a chance.

Then the day ended with a Food Truck party in Brush Square Park across the street. Austin is famous for its food trucks, all specialized in a certain type of food. And they’re good! I had a Tex Mex style wiener, which was really nice and spicy, a nice corn flour tortilla wrap with chicken, cilantro and chilli. As a desert, there was ice cream. Not just regular stuff, but… salted chocolate and red velvet cookies. Heaven, for a foodie. Again, a great vibe among the conference visitors.

#Xamarin food truck party! Great food. Tex mex spicy wiener, chicken taco, ... Must try for a foodie.

Xamarin just ordered 7 food trucks, all great stuff :-)

Red velvet cookie & salted chocolate ice cream... Goodness! #xamarin Foodtruck party.

After the foodtrucks were closed, we got together at Maggie Mae’s for more partying. Austin has a nice vibe, there’s live music all around.

So tomorrow is the last day of the conference already. How time flies. There’s one more session for Marcel and me to do. This one will be about code sharing. We’ll dive into some of the more detailed, sometimes basic type of tricks and architectural patterns you can apply to achieve more code sharing but still leave the app easily maintainable.

See ya in our session tomorrow!

 

Tags: ,

Xamarin Evolve 2013 – Day 2

Time flies. Day 2 of the Evolve conference has come to an end. Today was actually the second training day, and the conference itself has yet to start. Exciting!

The weather was nice again. Spent some time outside on the balcony, enjoying the sun and the warmth and a nice chat.

Austin

Today, the technical difficulties with the Wifi were gone so the training sessions went a bit smoother. Marcel and I actually started out in the Beginner’s track, that started with a session on navigation patterns. Some nice tips from Craig Dunn, who pointed us at the excellent Flyout Navigation and Sattellite Menu components, which provide new and modern navigation concepts for iOS apps.

After that, we jumped track back on the Advanced schedule for a module on Collection Views in iOS. The UICollectionView is a new UI paradigm in iOS, which drastically simplifies layouting collections of items in all sorts of forms. I recommend you take a look at this tutorial on the Xamarin docs site.

Speaking of docs, these last two days were a triumph for the Xamarin docs team. They wrote all the training material, which looks awesome and thorough. It is amazing how much great products and material is cranked out by Xamarin. The training material and the demo’s are exemplary of this.

The session I enjoyed the most was the one on Backgrounding, by Nina Vyedin. While she battled with the sound system that wouldn’t cooperate, she did a good job explaining the concepts around background tasks in both iOS and Android. Highlighting the similarities and differences, do’s and don’ts, before actually diving into code. All that with a couple of funny analogies to explain the concepts. Kudos.

Marcel and I had some work to do on our session, putting on the final touches, so we took some time in the afternoon to work on that. We did finish with the two modules on Code Sharing and Memory Management. Interesting talks. We’ll be speaking about our take on code sharing on Wednesday. The memory management module had some interesting tips on performance, something that’s very important in mobile apps. Mobile devices are not as powerful as laptop computers, so you have to be careful what you do with respect to memory usage and processor cycles.

The day ended with a fun and laid back welcome reception for the conference attendees. We had a couple of beers and some nice food and met some of the Xamarin folks. We decided to skip the GitHub Drinkup for tonight, but I hope everyone had fun there.

The reception featured a nice animation, projected on the big screen, that featured all nationalities present at Evolve. Very impressive. We learned that there are 11 Dutchies and I’m pretty sure that we’ve met them all :)

11 Dutchies at #xamarin Evolve! Impressive globe animation shows all nationalities present.

I haven’t gotten around to making more photo’s today, so these two will have to do. I did see another exciting bit of news fly by on Twitter today:

That’s awesome!

So tomorrow is going to be big! 200 additional attendees will arrive and join the 400 already here. The keynote by Nat and Miguel promises to be very exciting… Nat teased us in his welcome talk that there are going to be some very nice announcements. Can’t wait to find out!

I hope to see you guys in our session about Creating Unified Login for Apps. 2.30PM in the Gould Salon! Oh, and say hi to our colleague Henk, who’s manning the Info Support sponsor booth!

 

Tags: ,

Xamarin Evolve 2013 – Day 1

Austin, TX skyline

Hello from Austin, TX! So today was day 1 of the Xamarin Evolve conference. What a day! Marcel (@marcelv) and I flew in on Saturday and we arrived at the hotel late in the evening, so there was no time to check out downtown Austin, famous for its live music scene. It’s obvious as soon as you arrive on Austin airport.

Finally arrived in Austin for #xamarin Evolve w/ @marcelv

After a good night’s sleep, we went down to the conference area in the Hilton hotel to register and have a nice breakfast. Immediately, the great attention to detail Xamarin put into organising Evolve was apparent. Have a look at the conference badge:

Yeah, @InfoSupportBV present at #xamarin Evolve!Ready to go! #xamarin

The name badge also serves as a booklet containing the conference schedule and speaker information. The emphasis on the first name (printed in big bold letters) makes it personal and informal.

Next, the names of the conference rooms… They were all named after scientists related to Evolution (get it… Evolve) or monkeys. Illustrious people like Darwin, Dawkins, Gould, Goodall, Fossey, etcetera.

Things that make you feel that a lot of thought and attention to detail went into this conference. Xamarin can be proud of this.

We were also proud to see Info Support listed on the banner as a Silver Sponsor. :)

The welcome and keynote by Xamarin CEO Nat Friedman was nice. He told us how they were completely overwhelmed by the interest in Evolve. At first they anticipated around 250 people, but it soon went up to 400, and later on sold out at 600 people! Xamarin even had to change the venue and date in order to fit in all these people. A testament of Xamarin’s success and community passion for their products!

Passion is actually what describes Xamarin and Evolve best. All 70 (!) Xamarin employees are present at the conference, walking around, always available for a quick talk or questions, and all of them radiate passion for their job. The same with the participants. Mobile is fun. I’m confident that this vibe will stay during the remaining three days.

It was also great to meet and greet the Xamarin leaders. Nat, Miguel, Stephanie, all taking time to talk to everyone and eager to work together with their partners and the developer community.

This first day was dedicated to the Xamarin training. We did the Advanced track. After some technical difficulties – Wifi at a conference always sucks – we covered Notifications, Touch, Android Fragments, Animations and Graphics in iOS and Android. The training material is quite nice, as are the demo apps.

All day, we were very well taken care of in terms of food and drinks. Austin is a nice place for a foodie :) To celebrate our first day at Evolve, we were all invited to Stubb’s Bar-B-Q restaurant, where we enjoyed a nice BBQ… pulled pork, beef briskett, cole slaw, nachos and quacamole, you name it. All that in a nice atmosphere and accompanied with a couple of beers. Oh and great weather!

Great evening with a real Texas BBQ! Great to meet the passionate folks from #xamarin

Tomorrow it’s day 2 of the Advanced training. Looking forward to that. Tuesday and Wednesday are conference days, and then it’s our turn to talk about mobile development with Xamarin. See you at our sessions?

Tuesday, 2.30PM: Creating a Uniform Login for Apps
Wednesday, 1.30PM: Sharing up to 80% Code for iOS, Android and Windows

Airstream
 
Leave a comment

Posted by on 15 April 2013 in Info Support, Mobile, Work, Xamarin

 

Tags: , , , ,

An NServiceBus backplane for SignalR

On March 7th I did a presentation on Microsoft Techdays NL 2013 about SignalR. This is a great framework for real time messaging in websites and other .NET clients. It also works great on mobile devices. Check out my slides in my previous post here.

In this presentation, I used a Production Monitor application that runs NServiceBus in the back end to push events to our SignalR gateway. Schematically, this looks like this:

Production Monitor

This Production Monitor gathers info from our production application at De Vries Workforce Management, a SaaS workforce planning platform for large retail organizations. Besides technical data (are our databases up?), we also gather functional data (did all shops deliver turnover data in time, did all clock times come in?).

Of course there are all kinds of monitoring applications available in the market, so why build it ourselves? First of all, our application back end is comprised of NServiceBus services, publishing all kinds of events to form our business process. By running our monitoring application as an NServiceBus service, it can also listen to those events and do its checks accordingly. The second reason for me as an architect was that this case serves as a proof of concept and exploration on how NServiceBus combines with SignalR to provide real time communication to front ends. Something we’re contemplating on putting in our application as well in due time.

Scaling out SignalR with NServiceBus
The diagram above shows how NServiceBus publishes to a SignalR Gateway, who in turn sends the information to clients connected over the web. I’ll do a separate blogpost on that later. I’ll be doing a presentation on this with my lead dev and partner in crime Mark Taling at the Dutch SDN Event on March 18th in Zeist.

Playing with SignalR and NServiceBus together made me think about other scenario’s as well. One of the aspects that has been very nicely solved in SignalR is its scale-out scenario. Consider the following setup:

SignalR-Backplane

In a web farm that uses three servers running a SignalR gateway, with a load balancer in front, messages from one client connected to Server A, won’t be delivered to other clients what were routed to a different web server automatically. Server B wouldn’t know about messages sent through Server A without some extra help. For this, SignalR uses a so called “backplane”. Now, the backplane in SignalR is pluggable. Microsoft offers three possible backplanes out of the box: Redis, SqlServer and ServiceBus (built on the Azure/Windows ServiceBus).

Just for fun, I decided to build such a backplane using NServiceBus. You can find it here on GitHub.

Building a backplane for SignalR is not so difficult. Basically, you’ll need three main parts: the ScaleoutMessageBus, a Receiver, and the Backplane server process.

The ScaleoutMessageBus
You’ll need a class that inherits from Microsoft.AspNet.SignalR.ScaleoutMessageBus, which serves as the SignalR plugin for accessing the backplane.

    public class NServiceBusMessageBus : ScaleoutMessageBus
    {
        internal static IBus Bus;
        private readonly TaskQueue _publishQueue = new TaskQueue();

        public NServiceBusMessageBus(IDependencyResolver resolver, IBus busInstance)
            : base(resolver)
        {
            Bus = busInstance;
            Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall)
                .ConfigureProperty((r) => r.SignalRMessageBus, this);
        }

        internal void OnReceived(ulong id, Message[] messages)
        {
            _publishQueue.Enqueue(() => OnReceived("SignalR.NServiceBus", id, messages));
        }

        protected override Task Send(IList messages)
        {
            return Task.Factory.StartNew(() =>
                {
                    Bus.Send(m => m.Payload = JsonConvert.SerializeObject(messages.ToArray()));
                });
        }
    }

I decided to have the constructor receive an instance of IBus from the outside. This way, the hosting application can decide for itself how NServiceBus is initialized (what transport to use, what dependency injection framework, etc.). Also, this enables the bus that might already be present in the application to be reused.

SignalR will call the Send() method on this class as soon as a message needs to be sent to a group of clients. My implementation simply uses an NServiceBus command to wrap the payload, and send it via NServiceBus to the backplane server.

Furthermore, I made the OnReceived method available to other classes within the same assembly via a method overload. The reason for this is that the Receiver needs to be able to invoke OnReceived on the ScaleoutMessageBus base class, which is protected. SignalR requires that OnReceived can never be called in parallel, i.e. there can never be two invocations of OnReceived at the same time. This is why you’ll see a TaskQueue being used to queue up the invocation. I stole borrowed the TaskQueue and TaskAsyncHelper from the SignalR sources.

The Receiver
The Receiver is a separate class, which is a straightforward NServiceBus message handler:


    public class Receiver: IHandleMessages<MessagesAvailable>
    {
        public NServiceBusMessageBus SignalRMessageBus { get; set; }

        public void Handle(MessagesAvailable message)
        {
            var messages = JsonConvert.DeserializeObject<Message[]>(message.Payload);

            if (SignalRMessageBus != null)
            {
                SignalRMessageBus.OnReceived(message.PayloadId, messages);
            }
        }
    }

The SignalRMessageBus property is wired up by NServiceBus’s dependency injection framework. As soon as the handler is instantiated, a backpointer to the ScaleoutMessageBus is put into this property.

The handler is pretty straightforward: deserializing the Payload into an array of Message objects and passing it to the OnReceived handler. The null check is done because the handler might start receiving messages left in the queue before the SignalR initialized its ScaleoutMessageBus. Yes, this means that some messages get lost, so this could be a bit more robust. Possibly by deferring the message, or using second level retries.

The Backplane server process
The backplane itself is quite simple as well… We basically need an NServiceBus host running an endpoint with the SignalRMessageDispatcher handler. This handler receives DistributeMessages commands from any SignalR Gateway, and re-publishes the payload using Bus.Publish(). Note that this handler also makes sure that the PayloadId is unique. This is required by SignalR. I just copied this behavior from the SqlServer backplane, and it seems to work fine.


    public class SignalRMessageDispatcher: IHandleMessages<DistributeMessages>
    {
        private static ulong _payloadId = 0;
        private static object _lockHandle = new object();

        public IBus Bus { get; set; }

        public void Handle(DistributeMessages message)
        {
            var evt = new MessagesAvailable() { Payload = message.Payload };
            lock (_lockHandle)
            {
                _payloadId++;
                evt.PayloadId = _payloadId;
            }

            Bus.Publish(evt);
        }
    }

You’ll just need to create an NServiceBus Endpoint (e.g. just use the generic host) and run this message handler in it. For now, I’ve put in an EndpointConfig in the backplane assembly, but for more control, I think it needs to be taken out in order to let the developer decide how to initialize and run the Bus.

Wiring up
Now that we’ve got a ScaleoutMessageBus implementation based on NServiceBus and a backplane process, we’ll need to wire these up. First, the convention for wiring up the ScaleoutMessageBus in SignalR is to use an extension method for IDependencyResolver (the interface SignalR uses for dependency injection). This is what the UseNServiceBus() method in the DepencencyResolverExtentions class does:

    public static class DependencyResolverExtensions
    {
        /// <summary>
        /// Use NServiceBus backplane for SignalR.
        /// </summary>
        /// <param name="resolver">The dependency resolver.</param>
        /// <param name="busInstance">The instance of the NServiceBus IBus instance inside the current host.</param>
        /// <returns>The dependency resolver.</returns>
        public static IDependencyResolver UseNServiceBus(this IDependencyResolver resolver, IBus busInstance)
        {
            var bus = new Lazy<NServiceBusMessageBus>(() => new NServiceBusMessageBus(resolver, busInstance));
            resolver.Register(typeof(IMessageBus), () => bus.Value);
            return resolver;
        }
    }

You’ll use this extension method when initializing SignalR. In a web scenario, this is typically done from the Global.asax.cs in Application_Start():

    public static IBus Bus { get; set; }

    protected void Application_Start()
    {
        Bus = Configure
            .With()
                .DefaultBuilder()
                .MsmqTransport()
                .UnicastBus()
                    .LoadMessageHandlers()
                    .CreateBus()
                    .Start();

        GlobalHost.DependencyResolver.UseNServiceBus(Bus);

        RouteTable.Routes.MapHubs();

        // other initialization
    }

The NServiceBusMessageBus subscribes the Receiver message handler to the MessagesAvailable event. For this, it needs to know the endpoint address of the backplane endpoint. We simply put this in the (web).config of the SignalR Gateway host:

    <configuration>
      <configSections>
        <section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
        <section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
      </configSections>
      <UnicastBusConfig>
        <MessageEndpointMappings>
          <!-- the endpoint on which the backplane is listening for commands -->
          <!-- SignalR will subscribe to new messages via that endpoint -->
          <add Messages="SignalR.NServiceBus" Endpoint="backplanequeue@someserver" />
        </MessageEndpointMappings>
      </UnicastBusConfig>

      <MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
    </configuration>

To test this, just create a SignalR web application that uses the backplane. Next, copy the finished application to a second directory and map it as an extra application in IIS. Be sure to give it its own input queue. Start up the backplane process and fire up both website instances. You’ll see that messages sent to/from one website instance, are also delivered to the other.

Conclusion
This was a fun exercise to show how to extend SignalR with your own backplane to support a scale out scenario. The question is how scalable the backplane process itself is. The Azure ServiceBus backplane for example can scale out itself by adding more topics. These are sharded across multiple ServiceBus instances, something not supported in my version. It all depends on how massive your messaging needs are.

Nevertheless, this could be a nice starting point for using NServiceBus in your application for this purpose.

 
 

Tags: , , , ,

 
Follow

Get every new post delivered to your Inbox.