Build 2012 Recap

The Adventure of Build 2012
This has been and exciting year for technology especially around Windows8. Shortly after Build 2011, last year, I began my work with Windows8 and completed my first book ever Getting Started with Windows 8 Apps. A large part of this year has been spent really understanding all the pieces […]
Blog Post by: Ben Dewey

Creating a Custom Itinerary Messaging Service for ETW Tracing

ETW Tracing from the BizTalk Customer Advisory Team (CAT) is now increasingly used by developers for tracing in BizTalk applications. In the ESB toolkit it’s not implement so I wanted to see if it’s difficult to create a custom Messaging Service that uses ETW Tracing.

Steps

On MSDN on the Creating a Custom Itinerary Messaging Service page is explained how to create a custom Messaging Service. The following methods and properties are required:

  • The Name property is the name of the service as it will appear in an itinerary. It must match the configured name in the itinerary services configuration in the Esb.config file.
  • The SupportsDisassemble property indicates whether the custom messaging service you are creating supports disassemble and the execution of multiple resolvers.
  • The ShouldAdvanceStep method takes in the current itinerary step, and the current message, and returns a Boolean value that indicates whether the dispatcher should advance the itinerary after the service executes. In almost all cases, this method should return true.
  • The Execute method is of greatest importance for a messaging service and contains the logic that will be executed at run time. It takes in the pipeline context, the message, the resolver string, and the current itinerary step; and it returns the updated message.
In the code example on MSDN is only the ExecuteRoute method shown that is called by the Execute method. This method is not needed when you create your own Messaging Service. Therefore I used Reflector to disassemble the Routingservice to get also the other methods and properties.
 
On the Best Practices for Instrumenting High Performance BizTalk Solutions blog post from the CAT team you can get the source code for the ETW tracing.
 
In the example below is the “ExecuteTracing” method shown that is specific for the Tracing Service:
 
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
public IBaseMessage ExecuteTracing(IPipelineContext context, IBaseMessage msg, 
string resolverString) { // A call to the TraceIn method at the very beginning of an instrumented code. Guid g = TraceManager.PipelineComponent.TraceIn(); IBaseMessage message; if (context == null) { throw new ArgumentNullException("context"); } if (msg == null) { throw new ArgumentNullException("msg"); } try { // Get context properties from message string interchangeID = msg.Context.Read(BtsProperties.InterchangeID.Name,
BtsProperties.InterchangeID.Namespace) as string; string messageType = msg.Context.Read(BtsProperties.MessageType.Name,
BtsProperties.MessageType.Namespace) as string; string receivePortName = msg.Context.Read(BtsProperties.ReceivePortName.Name,
BtsProperties.ReceivePortName.Namespace) as string; string inboundTransportLocation = msg.Context.Read(BtsProperties.InboundTransportLocation
.Name, BtsProperties.InboundTransportLocation.Namespace) as string; // Writes an information message to the trace. TraceManager.PipelineComponent.TraceInfo("[InterchangeID: {0}]", interchangeID); TraceManager.PipelineComponent.TraceInfo("[MessageType: {0}]", messageType); TraceManager.PipelineComponent.TraceInfo("[ReceivePortName: {0}]", receivePortName); TraceManager.PipelineComponent.TraceInfo("[InboundTransportLocation: {0}]", inboundTransportLocation); message = msg; } catch (Exception exception) { EventLogger.Write(MethodBase.GetCurrentMethod(), exception); // Writes the exception details to the trace. TraceManager.PipelineComponent.TraceError(exception, true, g); throw; } // Writes an informational event into the trace log that a method is about to complete. TraceManager.PipelineComponent.TraceOut(g, "[Completed trace]"); return message; }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

 
In the esb.config in “C:\Program Files\Microsoft BizTalk ESB Toolkit 2.1” you have to add your
custom Itinerary Service.
 
Now you can create an Itineray with the custom TracingService:
 
The created itinerary can be tested with the Itinerary Test Client that is located in the ESB Toolkit
sample applications
 
Trace output:
 

Conclusion

In principle, it’s not very difficult to create a custom Messaging Service. Still it took a lot of time to create the service and to got the itinerary running because it’s not so well-documented,.

You can download the sample Messaging Service with the source code here:

http://code.msdn.microsoft.com/Creating-a-Custom-44338c2e

Sweden Windows Azure Group Meeting in November & Fast with Windows Azure Competition

SWAG November Meeting

There will be a Sweden Windows Azure Group (SWAG) meeting in Stockholm on Monday 19th November. Chris Klug will be presenting a session on Windows Azure Mobile Services, and I will be presenting a session on Web Site Authentication with Social Identity Providers. Active Solution have been kid enough to host the event, and will be providing food and refreshments.

The registration link is here: http://swag14.eventbrite.com

If you would like to join SWAG the link is here: http://swagmembership.eventbrite.com

Fast with Windows Azure Competition

I’ve entered a 3 minute video of rendering a 3D animation using 256 Windows Azure worker roles in the “Fast with Windows Azure” competition. It’s the last week of voting this week, it would be great if you can check out the video and vote for it if you like it. I have not driven a car for about 15 years, so if I win you can expect a hilarious summery of the track day in Vegas. My preparation for the day would be to play Project Gotham Racing for a weekend, and watch a lot of Top Gear.

My video is “Rapid Massive On-Demand Scalability Makes Me Fast!”.

The link is here: http://www.meetwindowsazure.com/fast/

SSO Database as a config store / SSO config application drops non-default permissions on any changes

SSO Database as a config store / SSO config application drops non-default permissions on any changes

About a year ago I used to religiously use the SSO database as a config store for my BizTalk applications, regardless whether there was a requirement around security or not. Back then the site I was working on had the all the BizTalk host accounts in the SSO affiliate application users group so by default […]
Blog Post by: Johann

Processing Binary Documents as XLANGMessages Through BizTalk Via Web Services

Processing Binary Documents as XLANGMessages Through BizTalk Via Web Services

Seroter has previously written about this in Processing Binary Documents Through BizTalk Via Web Services. I had to send a binary document to a SharePoint web service but in my case my document payload was not an element inside an XML document. The orchestration payload that contained my document was a un-typed MIME encoded XLANGMessage […]
Blog Post by: mbrimble

Interview Series: Four Questions With  Jürgen Willis

Interview Series: Four Questions With Jürgen Willis

Greetings and welcome to the 44th interview in my series of talks with leaders in the “connected technology” space. This month, I reached out to J%u00fcrgen Willis who is Group Program Manager for the Windows Azure team at Microsoft with responsibility for Windows Workflow Foundation and the new Workflow Manager (on-prem and in Windows Azure). […]
Blog Post by: Richard Seroter

Service Bus Messaging: Queues, SB-Messaging Adapter

Service Bus Messaging: Queues, SB-Messaging Adapter

Like some of you I have been experimenting with the Service Bus Queues, Topics and subscriptions. The information from Microsoft gives you a straight forward insight how to send messages to queues, topics and subscriptions using .NET.  The first step to interact with the Service Bus Queues, Topics and subscriptions is by creating an account with Windows Azure through a trail or buy option. The next step is creating a service namespace through the Windows Azure Portal followed by obtaining the management credentials you need when setting up Service Bus Connection string.  To create a solution that can interact with the Service Bus you need to have a reference in your Visual Studio project to the Microsoft.ServiceBus.dll on your machine, which is a part of the Windows Azure SDK. In your code template (for instance C# form) you will add two using statements:  

  • using Microsoft.ServiceBus;
  • using Microsoft.ServiceBus.Messaging;

Now everything is setup for coding your interaction with the Service Bus.  In this post I will show my sample I have built that sends messages to the queue. These messages are then read by the SB-Messaging Adapter from BizTalk Server 2010 R2 CTP. BizTalk Server is on a VM in the cloud (see my post on BizTalk Virtual Machine in Windows Azure using Quick Create and BizTalk Virtual Machine in Windows Azure using Quick Create-Part II). These messages are then stored in SQL Server 2008 R2 table using the BizTalk Server 2010 R2 CTP Adapter Pack WCF-SQL Adapter. Below you will see the diagram of the solution.

image

The client application is a .NET Windows Form application that will send messages to a queue in Windows Azure Service Bus. An application in BizTalk Server 2010 R2 has a port with a receive location configured with SB-Messaging Adapter. With the port a mapping will be performed to Insert Operation Message format. A send port has a subscription on messages with the SQL Insert format. The send port will send the messages to SQL Server 2008 R2 resulting in inserts in a SQL Table.

The client application

The client application is a Windows Form application. It has one form, where details can be filled for a runner like Name, number and time. I use the participants textbox to simulate a load to the Service Bus (see the latency section).  image
When I hit submit after filling in participants (i.e. 1), name, number and time the runner information will be sent a message to the Service Bus Queue.  image
The Service Bus Queue

Service Bus queue can be created through code, the service bus explorer within Visual Studio 2012, the Service Bus Explorer created by Paolo Salvatori (see my post Visual Studio Service Bus Explorer versus Standalone Service Bus Explorer) or through Windows Azure Portal.

image

BizTalk Server 2010 R2 Solution

The BizTalk Server solution consists of a schema of incoming messages from the Service Bus (runner message), a map and schema’s generated through Adapter Metadata Utility (i.e. Consume Adapter Service Add-in in Visual Studio 2012, see also TechNet Wiki article on Adapter Pack). Below you can see the artifacts created in a BizTalk project in Visual Studio 2012

Runner Schema

image

SQL Insert Operation Schema

image

Map

image

The solution is deployed to the BizTalk runtime and configured through the BizTalk Administration Console. The interesting part is the configuration of the receive location using the SB-messaging adapter.

Configuring the SB-Messaging Adapter

image

The first tab for configuring the SB-Messaging is setting the URL for Queue (see picture of the Service Bus Queue: QUEUE URL). In the Second Tab the Authentication you provide the management credentials of the namespace (BTUGNLD).image

The final tab properties you can enable promotion of Brokered Message Properties.

image

The configuration of the receive location is straight forward as you can see. The information on configuring this adapter in a receive location can be found on MSDN: How to Configure an SB-Messaging Receive Location.

Running the solution

When I run the client application a form will appear, where I can fill in the details of a runner.  image
After filling in the detail I hit submit. When a message is send I can see the duration of sending the message from the client to Service Bus Message Queue. On average it takes less than a second. On my VM in Windows Azure I query the RegisteredTimes table and will see the details of the runner.  image

Latency

Sending one message to Service Bus queue takes less than a second. Sending a 100 messages (setting participants to 100) will take about 2 seconds.

Number of Messages Duration (Latency) in seconds Messages/Sec
1 0.665 1.50
10 1.59 6.29
100 9.15 10.92
200 14.39 13.89
500 35.84 13.95
1000 68.07 14.69
10000 707 14.14
100000 ~7142 ~14

As soon as the client is finished with sending the messages I instantly check the database in my VM and query number of records in the table. All the records are there. So it’s safe to say that latency to have all messages pulled from the queue and inserted in SQL table is around the same time (i.e. duration to send to queue and few milliseconds later). With number of messages increasing the average duration (latency) is far less than a second to send a message to queue and then pick it up from queue to insert the message (data) into a table.  Throughput

Now 100000 messages would take about an 2 hours (extrapolate with measured data below) to be inserted in SQL Server table.

image

Usage Overview

Below you can see the number of messages going through the Service Bus Queue “registeredtimes”. There is a latency of a few minutes before actual number are shown (it is near real time).  image

Overall I am very impressed with this solution. Messages sent so quickly to a Service Bus queue and are then picked up by BizTalk Server 2010 R2 using the SB-Messaging adapter to store data in SQL Server 2008 R2.  Image that I would like to register all the finishing times of a marathon with 50000 participants or all finishing times including passing the 5, 10, 15, 20, 25 ,30, 35 and 40 km mark. That would accumulate in 450.000 messages. This can be quite some time (a few hours, see throughput) so scaling out with more queues, tune SQL Server and BizTalk would be a way to shorten the time.

You could of course use a queue for 5, 10, 15, 20, 25 ,30, 35, 40 km and finish mark. Or you could use topics and subscriptions for this. In my next post I will discuss a solution that will support this scenario using queues and topics/subscriptions including some fine tuning of the BizTalk / SQL Server. Interesting to see the latency and throughput then.

Stay tuned!

Azure: Windows Azure Community Conference-Chit Chat.

Halloween’s just over and my place was overrun with Kids of all sizes seeking high-fructose
corn syrup hitsto keep them going till the next house.

It seems Scott Gutherie has all sorts of pieces he wants to chat about on this next free
conference.

The world of the Cloud moves just so quickly that these sorts of events are essential
to get you up to date in your thinking.

Remember what the cloud story was 12 months ago & how many new features/capabilities
have been added since.

Check out the blurb and register.

http://www.windowsazureconf.net/

Blog Post by: Mick Badran

Installing HDInsight (Hadoop) on a single Windows box | Installation d’HDInsight (Hadoop) sur une machine Windows

Announced at the //build conference, HDInsight is available as a Web Platform Installer installation. This allows to have Hadoop on a Windows box (like a laptop) without requiring cygwin. Comme annonc%u00e9 %u00e0 la conf%u00e9rence //build, HDInsight est disponible %u00e0 l’installation depuis Web Platform Installer. Cela permet d’avoir Hadoop sur une machine Windows (un portable par exemple) sans n%u00e9cessiter cygwin.
Let’s see how to install this from a blank Windows Server 2012 server (example). Voyons ce que donne cette installation depuis une toute nouvelle machine sous Windows Server 2012 par exemple.

 

Go to http://www.microsoft.com/web aller %u00e0 http://www.microsoft.com/web

This installed the Web Platform Installer Cela a install%u00e9 le Web Platform Installer
Type HDInsight in the search box and press ENTER taper HDInsight dans la bo%u00eete de recherche et taper sur ENTREE

 

 

 

 

Benjamin

Blog Post by: Benjamin GUINEBERTIERE