BizTalk management classes

BizTalk management classes

A couple of months ago I joined with Michel Hubert and Maxime Labelle to build the next version of the Powershell provider for BizTalk. (Also see my earlier posts here and here).
We%u00b4re currently very close to releasing the first beta of this new version.
The provider now uses a separate object layer for BizTalk management tasks. […]

The People’s Jukebox

The People’s Jukebox

[Source: http://geekswithblogs.net/EltonStoneman]

For a forthcoming celebration, I’ve been working on a jukebox web application:

The client controls the music being played on the server, so its intended for local networks where you want shared control of a central music player. If you can find a use for it, help yourself – it’s on CodePlex here: The People’s Jukebox. If nothing else it’s a straightforward example of a Silverlight 2.0 client talking to WCF REST services, in what’s probably a familiar domain.

The user experience is meant to be zero-guidance. You can try it out on a version where the UI functions but doesn’t play any music: The People’s Jukebox on sixeyed.com.

The initial screen shows what’s currently playing and has a big button for you to select a track. In the next screen you choose either to search for a specific track, browse through the collection, or have the jukebox randomly choose some options for you. From any of those routes, you select a track, confirm your choice and it gets queued:

The queuing is what gives The People’s Jukebox its democratic flavour – if you select a track which is already queued, you increment its vote count. When the current track finishes, the jukebox picks the next track with the most votes. When a track is selected the UI forces you to wait for a few seconds before you can continue, to discourage The People from abusing their power and making the same selection over and over again.

If no one’s choosing tracks, the jukebox will randomly pick one which it hasn’t already played, so it should keep playing until all the songs are played, or the web server is stopped.

Usage

Run the MSI and the jukebox Web site and services will be installed with default configuration options, using the installing user’s “My Music” as the root folder to look for tracks. It will populate the track catalogue from the file system, expecting to find a conventional root/artist/album/track hierarchy:

  • My Music
    • The Beatles
      • Abbey Road
        • 01. Come Together
        • etc.

Open http://localhost/ThePeoplesJukebox/ and hit Start – the music should start playing and you should be able to navigate around your music collection. The jukebox services log everything they do, by default to C:\TEMP\PeoplesJukeboxService.log, so if nothing happens that’s the place to look for clues.

Configuration

The jukebox is configurable through Web.config on the services. Options are documented in comments – the installer sets up the root music directory, and the types of music files in the fileSystemConfiguration element:

<!–Specify the root path for music files, and

the types of files to load. Directory can be

a network path, extensions are comma-separated:–>

<fileSystemCatalogueConfiguration

rootDirectory=x:\My Music

fileExtensions=*.wav,*.mp3

/>

rootDirectory can be local or a UNC path, e.g. \\nas\music.

Track Lists

Track lists are what drives the song selection behaviour; this is also configurable. Three types of tracklist are provided. When the jukebox finishes playing a track, it will query the tracklists in priority order until one returns a track, which will be loaded and played next:

<!– Tracklists to use, and the order in which they are queried.

Specify “chosenByText” to display which tracklist chose the

Now Playing track on the client –>

<trackLists>

<trackList type=PeoplesJukebox.Core.TrackLists.ConfiguredTrackList, PeoplesJukebox.Core priority=1/>

<trackList type=PeoplesJukebox.Core.TrackLists.SelectedTrackList, PeoplesJukebox.Core priority=2 chosenByText=The People/>

<trackList type=PeoplesJukebox.Core.TrackLists.RandomTrackList, PeoplesJukebox.Core priority=3/>

</trackLists>

In default form, the jukebox lets you start off with some specified songs, moving onto the selections of The People, with the jukebox picking a random track if none are queued, so tracklists are queried in the following order:

1. ConfiguredTrackList – reads a list of specific track names from configuration, and returns them in priority order. Will not play a track that’s already been played. Configuration looks like:

<trackConfiguration>

<tracks>

<track trackName=Blank Slate position=1/>

<track trackName=Love Is Noise position=2/>

</tracks>

</trackConfiguration>

Intended to start the evening off with a known selection, when the configured tracks have been played, the list returns null so the jukebox moves on to the next tracklist.

2. SelectedTrackList – hopefully the main provider, queues up track requests as users make a selection. Operates the voting mechanism, so tracks which are selected multiple times move up the queue. If all queued tracks have the same number of votes, they’re played in the order they were first selected. Will allow tracks to be played multiple times, but not sequentially – if you choose a track that’s already queued, you increase its vote count; if you choose the same track again whilst its playing, or after it has been played, it gets queued again. Returns null if no tracks are queued.

3. RandomTrackList – failsafe list, to ensure music is always playing, picks tracks at random from the catalogue. Will not play a track that’s already been played. Allows the administrator to sneak in some favourites by configuring “must-have” tracks. Must-haves will be inserted between random selections, at a configured frequency:

<randomTrackListConfiguration mustHaveTrackFrequency=5>

<mustHaveTracks>

<track trackName=Black Eyed Dog position=1/>

<track trackName=The Magic Position position=2/>

</mustHaveTracks>

</randomTrackListConfiguration>

– meaning every fifth track will be picked from the configured list, then the next four will be random. If no must-haves are specified, or they have all been played, the selection will be random.

Technical Details

Much of the implementation is straightforward. WCF has in-built support for REST, so you can expose a WCF service with a RESTful endpoint like http://localhost/PeoplesJukebox.Services/CatalogueService.svc/artist/2 (to get the list of tracks from artist with ID=2 from the catalogue service), just by flagging the service implementation with the WebGet attribute:

[WebGet(UriTemplate = “artist/{artistId}”, ResponseFormat = WebMessageFormat.Xml)]

public Artist GetArtist(string artistId)

{…

Task-driven workflow implementation in Silverlight is also straightforward, by hosting multiple pages on the application, all of which are invisible except the current page. When the current page completes, it hides itself and loads the next page – handled through events in Page.xaml.cs:

public Page()

{

InitializeComponent();

foreach (PageBase page in Pages)

{

page.Complete += new PageBase.OnCompleteEventHandler(PageComplete);

page.Cancelled += new PageBase.OnCancelledEventHandler(PageCancelled);

}

this.CurrentPage = this.ucStartPage;

}

Silverlight 2.0 doesn’t work so well with non-GET web requests, which is why all the services are GETs where some should really be POSTs.

The only difficult part was playing music files through IIS in a background thread, while continuing to respond to web service and web site requests. If you’re really interested in looking into this, you’ll see the music playing component is also specified in config:

<!– Core configuration – which implementations to use for

media player and catalogue components –>

<peoplesJukeboxConfiguration

mediaPlayer=PeoplesJukebox.Core.Players.FMODPlayer, PeoplesJukebox.Core

mediaCatalogue=PeoplesJukebox.Core.Catalogues.FileSystemCatalogue, PeoplesJukebox.Core

>

There are several (failed) implementations in the source which are not built in the solution (under ..\PeoplesJukebox\PeoplesJukebox.Core\Players). Of the five attempts, all of them had showstopper issues except the excellent FMOD library:

  • DirectX – using the Audio class from the managed wrapper in the DirectX SDK. Redistributable install is massive, which is offputting, but more importantly the Audio.Ending event didn’t fire reliably, so playback would intermittently stop and never resume;
  • Windows Media Player – using the managed WMPLib wrapper in the Windows Media Player SDK, to devolve playing responsibility to Media Player. Didn’t like the extra dependency, or the alarming memory profile. Worse, the player would randomly change state to Stopping in the middle of playback and not resume;
  • Sound – using .NET’s native sound player in System.Media. Fine for playing WAVs, at the cost of having to manage your own threads. Main issue that WAVs are not normalized so tracks will be played at their native volume, which is likely to mean volume changes between songs. Unable to play other media types;
  • Alvas Audio – looked good, but highly unfriendly API. Couldn’t get the thing to play at all;
  • FMOD – highly-featured C++ audio processor which does its own thread management, copes with various media types, plays reliably for extended periods and has an efficient memory model. The library is free for non-commercial use, so The People’s Jukebox has the same restriction. The library is complex, but I’ve used it through FMOD.NET – Rafael Nicoletti’s very nice C# wrapper.

The mediaCatalogue element lets you choose how the catalogue is built. Currently, only a file system catalogue is provided, but extending it (e.g. to use SqueezeCenter – now SqueezeBox Server), is an option.

If you download the jukebox and find any issues using it, let me know through a comment or a CodePlex bug.


SharePoint, workflow, human workflow where does it go?

We got together recently at teched, and spoke about the concept of workflow, and SharePoint being a great host for human based workflow.

No I have not changed my spots to become a SharePoint person, I have enhanced my spots my looking above and beyond what just BizTalk can offer. There is a lot more to life these days, for those who have been living in the dark, there is the whole world of connected systems, and workflow foundation.

The opportunities to use the technology that BizTalk started have expanded. This is one example of thinking out side of the box, and taking full advantage of this technology. It may even go as far as explain where BizTalk is positioned in light of Dublin, and the new WF 4.0.

SharePoint is a good user interface, it can provide workflow capabilities, but more importantly it can draw users in and get them to fill in forms and answer the questions that a human based workflow might require, such as approvals, or provide this invoice, and the like, these can all be handled in a document library in SharePoint. They are placed there perhaps as part of a workflow, or part of a business process.

StreamInsight

StreamInsight

You are probably asking what is StreamInsight.  Well, it is the platform for performing Complex Event Processing (CEP) from Microsoft.  Actually to quote exactly what it is – it is a “platform for the continuous and incremental processing of unending sequences of events (event streams) from multiple sources with near-zero latency”.


There has been a need to deal with processing at near zero latency for some time.  Many times existing products can perform at low latency and that has been acceptable, however, there are a number of situations where low latency wasn’t sufficient.  That is where Complex Event Processing comes in. 


According to Wikipedia CEP is defined as:  primarily an event processing concept that deals with the task of processing multiple events with the goal of identifying the meaningful events within the event cloud. CEP employs techniques such as detection of complex patterns of many events, event correlation and abstraction, event hierarchies, and relationships between events such as causality, membership, and timing, and event-driven processes.  CEP is to discover information contained in the events happening across all the layers in an organization and then analyze its impact from the macro level as “complex event” and then take subsequent action plan in real time.


Some of the scenarios that call for CEP are:


Manufacturing: Sensors on the plant floor capturing data through device controllers and aggregating data consisting of tens of thousands of events per second with requirements to act on patterns detected to ensure product quality


Web analytics: Instrument server to capture click-stream data and determine online customer behavior


Financial services: Listening to data feeds like news or stocks. Use that data to run queries looking for patterns that find opportunities to buy or sell stock


Some of the features of StreamInsight listed on the download site are:



  • Derive meaningful and relevant information from data/events streams through complex patterns. These patterns can be defined using a declarative query paradigm based on well-defined streaming semantics with LINQ as query language.

  • For the development of applications, adapters, and analytics, the user can rely on well-established and powerful development frameworks and tools such as .NET, LINQ, and Microsoft Visual Studio.

  • The platform integrates with various data sources and sinks through input and output adapters. The framework to build domain-specific adapters utilizes a .NET API to make adoption of the platform easy. Independence between adapters and queries facilitates seamless integration of real-time and historical analysis.

  • The platform architecture supports a variety of deployment options, from scenarios with a low-footprint embedded option to high-end server deployments.

  • A rich set of manageability features such as a management interface, a diagnostic interface and a debugging tool are provided as part of the platform.

You can start working with the CTP by downloading it at: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=a3faa562-b6dc-4702-90c6-bf8e08df3b8b

MSDTC issue in BTS 2009 virtualization environment

MSDTC issue in BTS 2009 virtualization environment

This is a repost of Ahmed Irkakene’s mail to his fellow BizTalk colleagues.

 

======================================================================

 

I have been working with a customer last time to install several BTS 2009 systems.   Customer was cloning  his initial VMware system.

As a result he is facing problem with MSDTC:  “MSDTC not configured correctly.”

MSDTC component, during its transactional operations, needs basically SID and NetBios name to be resolved.

As you imagine without MSDTC, BizTalk server can’t do much.

When cloning system, the customer should:

1. Use sysprep tool to get a new SID for each system  ( DO NOT newsid tool as it’s NOT supported )

%u00f0 As a consequence, the system will be removed from its domain.

2. Re-install properly MSDTC

Before joining the domain again, please follow the steps below to make sure the MSDTC is correctly installed.

a. MSDTC -Uninstall

b. Reboot

c. MSDTC -Install

d. Reboot

Make sure the domain replication is occurred ( or force it to occur), otherwise you may get the following error even if the system joined the domain:

The security database on the server does not have a computer account for this workstation trust relationship

Also, one more important thing ( mainly when using static IP address but still valid for dynamic ones ):

As mentioned earlier, MSDTC needs name resolution and therefore “Enable NetBIOS over TCP/IP” should be enabled on all systems (adapters network) involved in the scenario.

clip_image002

DTCTester

DTCTester

According to the DTCTest tool documentation, you create a DSN, and run the DTCTester.exe

When I ran it, I got the following error:

SQLSTATE=IM002,Native error=0,msg='[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified’

The tool is 32 bit, and access the ODBC for the 32 bit client, not the 64 bit client that is in the Administration Console. To access the 32 bit client, you have to open up: c:\windows\syswow64\odbcad32.exe

The team is getting ready for PDC; are you?

The team is getting ready for PDC; are you?

The 2009 Professional Developers Conference (PDC) is less than a couple months away, and the team is starting to create content and demos for the event. The team has been working with PDC event management over the last couple months to secure sessions and space at the event; and I wanted to share with you how the event is shaping up, as well as make a plug for our sessions.

The event will deliver a lot of really great material, as well as provide you with access to folks who are writing the code. We hope you can make it down to Los Angeles in November for the event.

PDC Sessions Of Note

So far, four sessions are currently live on the PDC event website:

In addition to the sessions being done by the team, WCF comes up in several other sessions of note at the event:

We are working very hard to not present the same content as last year.

For WF, we’re building upon last year’s introductions to WF4 to expose more of the underlying architecture of the new WF runtime, really giving you a view into how different the new runtime isand demonstrating how workflow services work in the new Windows Application Server technology (codename ’Dublin’).

For WCF, we heard you loud and clear that there wasn’t enough WCF content. This year, we have a session focusing on the WCF enhancements coming in .NET 4, in addition to the sessions covering how WCF is used with HPC Server, Silverlight, and covering advances in ADO.NET Data Services (which is built upon WCF).

And, last but not least, last year’s PDC introduced the technology called ’Dublin’ – and it’s been a hot topic for customers ever since PDC. This year, we dive deeper into how ’Dublin’ lights up WCF and WF applications and where we’re going with the technology.

We have a few more excellent sessions in the pipeline covering technology futures; and I’ll post the updated list up here when the next batch of sessions goes live.

On the Floor of the Event

Beyond sessions, speakers and other team members will be at the event in the lounge area for Framework and Tools, both to hang out and chat with you about the technologies, as well as working a couple booths in the lounge area to show the technologies in action.

Anyone attending PDC is encouraged to stop down to the lounge and say hello. Bring your questions or just share your thoughts on the technologies; we truly love meeting our customers – and your comments and questions do have direct impact on the shape of the future platform. If there’s someone in particular you would like to connect with, let me know – I’m happy to share folks’ lounge schedules as we come up on the event and schedules are finalizedjust let me know who you’re looking to connect with or a particular topic you want to drill down on.

We are currently working on getting a small 20-seat chalk-talk area in the lounge area again this year to do smaller, more niche discussions. We’ll post more on that topic here in the coming weeks, as well, as we make progress on that front.

Pre-PDC Workshops

And, lastly, it’s worth noting that Michele Leroux Bustamante will be running a pre-PDC workshop covering the Microsoft Technology Roadmap, helping workshop attendees understand how the many technologies that make up the .NET Framework fit together – from A-W (Azure to Azure). ^_^

There is also a FREE Windows 7 Developer Boot Camp pre-PDC workshop that is open to anyone (whether attending PDC or not) as long as there is room.

Not registered? There’s still room!

There’s still room at the event, and I hear they have a $300 discount for folks registering before October 13 (and there’s also a significant discount for students and employees of academic institutions). And there is still plenty of hotel availability around the convention center as of a couple weeks ago (when I registered). A couple of the closest hotels were full, but there are still plenty of quality ones about.