May 20th Links: ASP.NET MVC, ASP.NET, .NET 4, VS 2010, Silverlight

Here is the latest in my link-listing series.  Also check out my VS 2010 and .NET 4 series and ASP.NET MVC 2 series for other on-going blog series I’m working on.

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

ASP.NET MVC

  • How to Localize an ASP.NET MVC Application: Michael Ceranski has a good blog post that describes how to localize ASP.NET MVC 2 applications.

  • ASP.NET MVC with jTemplates Part 1 and Part 2: Steve Gentile has a nice two-part set of blog posts that demonstrate how to use the jTemplate and DataTable jQuery libraries to implement client-side data binding with ASP.NET MVC.

  • How to Configure VS 2010 Code Coverage for ASP.NET MVC Unit Tests: Visual Studio enables you to calculate the “code coverage” of your unit tests.  This measures the percentage of code within your application that is exercised by your tests – and can give you a sense of how much test coverage you have.  Gunnar Peipman demonstrates how to configure this for ASP.NET MVC projects.

  • Shrinkr URL Shortening Service Sample: A nice open source application and code sample built by Kazi Manzur that demonstrates how to implement a URL Shortening Services (like bit.ly) using ASP.NET MVC 2 and EF4.  More details here.

  • Creating RSS Feeds in ASP.NET MVC: Damien Guard has a nice post that describes a cool new “FeedResult” class he created that makes it easy to publish and expose RSS feeds from within ASP.NET MVC sites.

  • Using the FCKEditor with ASP.NET MVC: Quick blog post that describes how to use FCKEditor – an open source HTML Text Editor – with ASP.NET MVC.

ASP.NET

  • Integrating Twitter into an ASP.NET Website using OAuth: Scott Mitchell has a nice article that describes how to take advantage of Twiter within an ASP.NET Website using the OAuth protocol – which is a simple, secure protocol for granting API access.

.NET 4

  • Entity Framework 4 Video Series: Julie Lerman has a nice, free, 7-part video series on MSDN that walks through how to use the new EF4 capabilities with VS 2010 and .NET 4.  I’ll be covering EF4 in a blog series that I’m going to start shortly as well.

  • Getting Lazy with System.Lazy: System.Lazy and System.Lazy<T> are new features in .NET 4 that provide a way to create objects that may need to perform time consuming operations and defer the execution of the operation until it is needed.  Derik Whittaker has a nice write-up that describes how to use it.

  • LINQ to Twitter: Nifty open source library on Codeplex that enables you to use LINQ syntax to query Twitter.

Visual Studio 2010

  • Using Intellitrace in VS 2010: Chris Koenig has a nice 10 minute video that demonstrates how to use the new Intellitrace features of VS 2010 to enable DVR playback of your debug sessions.

  • How to maintain control of your code using Layer Diagrams: Another great blog post by Jennifer Marsman that demonstrates how to setup a “layer diagram” within VS 2010 to enforce clean layering within your applications.  This enables you to enforce a compiler error if someone inadvertently violates a layer design rule.

  • Collapse Selection in Solution Explorer Extension: Useful VS 2010 extension that enables you to quickly collapse “child nodes” within the Visual Studio Solution Explorer.  If you have deeply nested project structures this extension is useful.

Silverlight and Windows Phone 7

Hope this helps,

Scott

P.S. If you haven’t already, check out this month’s "Find a Hoster” page on the www.asp.net website to learn about great (and very inexpensive) ASP.NET hosting offers.

Using NServiceBus behind a custom web service

In this post I’d like to talk about an architecture scenario we had recently and how we were able to utilise NServiceBus to help us address this problem.

Scenario

Cognos is a reporting system used by one of my clients. A while back we developed a web service fa%u00e7ade to allow line of business applications to be able to access reports from Cognos to support their various functions.

The service was intended to provide access to reports which were quick running reports or pre-generated reports which could be accessed real-time on demand. One of the key aims of the web service was to provide a simple generic interface to allow applications to get any report without needing to worry about the complex .net SDK for Cognos.

The web service also supported multi-hop kerberos delegation so that report data could be accesses under the context of the end user.

This service was working well for a period of time.

The Problem

The problem we encountered was that reports were now also required to be available to batch processes. The original design was optimised for low latency so users would enjoy a positive experience, however when the batch processes started to request 250+ concurrent reports over an extended period of time you can begin to imagine the sorts of problems that come into play. The key problems this new scenario caused are:

  1. Users may be affected and the latency of on demand reports was significantly slower
  2. The Cognos infrastructure was not scaled sufficiently to be able to cope with these long peaks of load

From a cost perspective it just isn’t feasible to scale the Cognos infrastructure to be able to handle the load when it is only for a couple of hour window each night. We really needed to introduce a second pattern for accessing this service which would support high through-put scenarios.

We also had little control over the batch process in terms of being able to throttle its load. We could however make some changes to the way it accessed the reports.

The Approach

My idea was to introduce a throttling mechanism between the Web Service Fa%u00e7ade and Cognos. This would allow the batch processes to push reports requests hard at the web service which we were confident the web service can handle. The web service would then queue these requests and process them behind the scenes and make a call back to the batch application to provide the report once it had been accessed.

In terms of technology we had some limitations because we were not able to use WCF or IIS7 where the MSMQ-Activated WCF services could have helped, but we did have MSMQ as an option and I thought NServiceBus could do just the job to help us here.

The flow of how this would work was as follows:

  1. The batch applications would send a request for a report to the web service
  2. The web service uses NServiceBus to send the message to a Queue
  3. The NServiceBus Generic Host is running as a windows service with a message handler which subscribes to these messages
  4. The message handler gets the message, accesses the report from Cognos
  5. The message handler calls back to the original batch application, this is decoupled because the calling application provides a call back url
  6. The report gets into the batch application and is processed as normal

This approach looks something like the below diagram:

The key points are an application wanting to take advantage of the batch driven reports needs to do the following:

  • Implement our call back contract
  • Make a call to the service providing a call back url
  • Provide a correlation ID so it knows how to tie each response back to its request

What does NServiceBus offer in this solution

So this scenario is not the typical messaging service bus type of solution people implement with NServiceBus, but it did offer the following:

  • Simplified interaction with MSMQ
  • Offered the ability to configure the number of processes working through the queue so we could find a balance between load on Cognos versus the applications end to end processing time
  • NServiceBus offers retries and a way to manage failed messages
  • NServiceBus offers a high availability setup

The simple thing is that NServiceBus gave us the platform to build the solution on. We just implemented a message handler which functionally processed a message and we could rely on NServiceBus to do all of the hard work around managing the queues and all of the lower level things that would have took ages to write to any kind of robust level.

Conclusion

With this approach we were able to deal with a fairly significant performance issue with out too much rework. Hopefully this write up gives people some insight into ideas on how to leverage the excellent NServiceBus framework to help solve integration and high through-put scenarios.

BizTalk Server 2010 Public Beta and Windows Server AppFabric RC now available

In case you missed the Application Infrastructure Virtual launch today (you can go watch it on demand), Microsoft has made available:

  • BizTalk Server 2010 beta, get it here (note that the ESB Toolkit 2.1 beta is on that page also)
  • The Windows Server AppFabric release candidate, get it here

You can read the official announcement on the BizTalk team blog, and also here at the Endpoint blog.

Make sure you check out the new mapper functionality in the BizTalk, it ROCKS! What seems like a simple problem quick deteriorates into some very complex UI issues, and the team has really done a great job in providing a UI that nicely addresses those challenges, and more.

One of the coolest features of the mapper is the new “indicate match” capability. In the screen shot below, I right-clicked the “PO403” node, the mapper thought “PONumber” was the best match, but that the other “PONumber”  and “PODate” were also possible matches. Very very nice!!

 

 

Happy downloading!!

BizTalk 2010 Beta is now Available

Hey all

It was just announced at the Application Infrastructure Virtual Launch event that the public betas for both BizTalk Server 2010 and the ESB Toolkit 2.1 are now available. You can download them at http://www.microsoft.com/downloads/details.aspx?FamilyID=0f852e77-f792-4784-b2d4-95113d40db64&displaylang=en

If you didn’t see my previous post about the Launch event, you can access it at http://www.appinfrastructure.com/

Cheers and stay connected.

Peter

Now available!: Windows Server AppFabric RC and BizTalk Server 2010 beta

Several weeks ago, I told you about our upcoming Application Infrastructure Virtual Launch event. Today, I am pleased to announce the availability of the Windows Server AppFabric Release Candidate (RC). To learn more, I recommend tuning into the keynote (and the many other sessions we have going on) today at the App Infrastructure Virtual Launch event!


Here’s a brief overview of the announcements we’re making during the event this morning:


First off, we’re officially launching Windows Server AppFabric, with the immediate availability of the Windows Server AppFabric Release Candidate (RC); the final RTM release will be available for download in June. I would like to invite you to check out the new Windows Server AppFabric MSDN page (also revamped today!) and download the release candidate to get started.


Also today, we’re excited to announce the availability of the first BizTalk Server 2010 Beta; which now seamlessly integrates with Windows Server AppFabric, combining the rich capabilities of BizTalk Server integration and the flexible development experience of .NET to allow customers to easily develop and manage composite applications. To learn more (and download the beta), visit the BizTalk website at www.microsoft.com/biztalk.


Together with the already available Windows Azure AppFabric, Windows Server AppFabric and BizTalk Server 2010 form Microsoft’s application infrastructure technologies, bringing even more value to the Windows Server application server. These offerings benefit developers and IT pros by delivering cloud-like elasticity, high availability, faster performance, seamless connectivity, and simplified composition for the most demanding, enterprise applications.


If you’ve been following this blog, we hope you’ve been enjoying the technical insights that the product team has been providing into AppFabric and the underlying technologies (WCF and WF). To gain a broader context about our technologies, and to gain access to a wealth of technical resources, be sure to visit the virtual launch event. In particular, here are some specific sessions and content that the team would like to highlight for your consideration:



  • Application Server Session

  • Enterprise Integration Session

  • Windows Server AppFabric Product Stand

Following the Virtual Launch Event, there will be a number of local community launch events around the globe where developers and IT Pros can attend, in-person, to learn more about Microsoft’s application infrastructure and talk with others in the .NET community about how these technologies make the lives of developers and IT Pros easier. Be sure to check with your local user group to see if we have an event near you.

The BizTalk Server 2010 Beta is here!

Today we’re excited to announce the availability of the BizTalk Server 2010 Beta, which will RTM in the third quarter of calendar year 2010. BizTalk Server 2010 aligns with the latest Microsoft platform releases, including SQL Server 2008 R2, Visual Studio 2010 and SharePoint 2010, and will integrate with Windows Server AppFabric. This alignment, along with the availability of a wide array of platform adapters, allows customers to stitch together more flexible and manageable composite applications.

Updates include enhanced trading partner management, a new BizTalk mapper and simplified management through a single dashboard that enables customers to backup and restore BizTalk configurations. Also included in this release are new Business to Business integration capabilities such as rapidly on-board and easy management of trading partners and secure FTP adapter (FTPS) .
Download the beta today and tell us what you think at www.microsoft.com/biztalk.

Today we’re also officially launching Windows Server AppFabric, with the immediate availability of the Windows Server AppFabric Release Candidate (RC) at http://msdn.microsoft.com/appfabric; the final release of the product will be available in June.

Together with the already available Windows Azure AppFabric, Windows Server AppFabric and BizTalk Server 2010 form Microsoft’s application infrastructure technologies. These offerings benefit you by delivering cloud-like elasticity, seamless connectivity, and simplified composition for the most demanding, enterprise applications.

To learn more about Microsoft’s application infrastructure technologies, visit the Microsoft Application Infrastructure virtual launch event at www.appinfrastructure.com!