by community-syndication | Sep 20, 2010 | BizTalk Community Blogs via Syndication
Summary: Financial Messaging Services Bus (FMSB) is a vertical industry implementation of Microsoft’s Enterprise Service Bus Toolkit 2.0 on top of BizTalk Server 2009 and BizTalk Accelerator for SWIFT. FMSB greatly improves time to market for many complex integration solutions especially in Banking and Capital Markets industries. This paper explains the rationale behind FMSB creation, provides a high%u2010level description of FMSB architecture, and discusses how FSMB is used to simplify application connectivity to SWIFT. FMSB helps software developers and solution architect by providing components and functionalities within engine which saves development time and give more value from the engine itself.
This document assumes the reader has a basic understanding of generic ESB concepts. For further reading on the Microsoft ESB Toolkit, refer to: http://www.microsoft.com/soa/solutions/esb.aspx Lets use this link: http://msdn.microsoft.com/en-us/biztalk/dd876606.aspx
Financial solutions (but this apply to any industry solution at the end), especially those implementing or leveraging a full-fledged messaging framework , can in fact constitute a foundation platform for the development of a specific application domain (payment or capital markets, government solution, manufacturing,..) where integration technology, data transformation, workflow management and other intermediary services are used to orchestrate transaction flows among different systems running on different, heterogeneous platforms. In addition to messaging, some commonly used services implementing specific behaviors are required for transaction processing, e.g., validation, routing, exception management, and repair. By developing these mechanisms as reusable services, the messaging infrastructure becomes more than an integration framework – it takes on the nature of a bus architecture where the lifecycle of a transaction can be mapped, calling the appropriate services as necessary. This is the essence of the FMSB (ESB): taking common processing services, abstracting and bundling them as reusable services that can be configured at implementation time and track execution KPI data as well as custom defined KPI. In addition, such services can be exposed to third party applications to leverage the preconfigured processing of the bus components, therefore enhancing client value. When defining FMSB, it is important to note that these services are business services, as defined by Microsoft Enterprise Service Bus (ESB) 2.0. The over%u2010arching concept is to use ESB to orchestrate all services and reuse them as needed.
The basic architectural elements of a financial services application can be categorized into the following segments or layers as shown in Figure 1.
Figure 1: Financial Application Architecture
When considering the architecture of a financial services application, FMSB sits in the layer known as “Business Process and Orchestration”, which is covered by the Microsoft technology stack, and provides integration, orchestration, transformation, and workflow services.
FMSB can be deployed directly to a financial institution client infrastructure project, but also embedded in a Microsoft partner application solution.
FMSB and Microsoft ESB
The FMSB is built principally on BizTalk Server because many of the services are implemented using BizTalk and Accelerator for SWIFT components. To conform to BizTalk ESB architectural best practices, the FMSB was developed upon the BizTalk ESB Toolkit. Most of the FMSB components are very generic and reusable for any solution built on ESB Toolkit.
The base ESB architecture is also the base architecture for FMSB as shown in Figure 2
Figure 2: FMSB and ESB
Financial Messaging Service Bus extends ESB by providing:
- Resolvers which simplify solution creation by implementing support for:
- Multipart messaging (Read Message Part, Replace Message Part)
- Retrieve configuration from Dashboard (FMSB Value)
- Retrieve complex configuration data for SWIFT service (SWIFT Service) (not covered as part of this post)
- Storing itinerary designer value into itinerary runtime
- Loopback adapter (message doesn’t leave message box)
- Configuration model for defining BAM tracking data for service/itinerary execution
- Service Broker Orchestration implementation
- Silverlight Dashboard (built on Composite framework (previously known as Prism)) with 5 modules
- Set of Financial services and itineraries together with configuration model (not covered as part of this post)
FMSB Architecture
FMSB Architecture is presented in the following figure:
Figure 3: FMSB architecture as add-on for ESB (red circles represent FMSB add-ons)
FMSB provides:
-
Core extensions of ESB (enhanced runtime, tracking KPI during itinerary execution)
-
Extended Exception handling (support for invoking pre-defined exception itinerary)
-
Loopback adapter (helps to mix messaging and orchestration services inside same itinerary)
-
Configuration database (new fmsb resolver extends BRE and UDDI resolvers and provides generic configuration on the Silverlight dashboard)
-
Silverlight self-service dashboard (for monitoring Live Data, view KPI Reports, Configuring KPI (BAM), SWIFT service administration)
-
Interact and FileAct (specific SWIFT SAG adapters) support (not covered as part of this post)
FMSB Components
FMSB has several modules which could run and be installed separately:
-
CORE modules – those modules could be reused without SWIFT modules. Artifacts include resolvers, adapter, orchestration service broker, database, entity framework models..
-
SWIFT modules – those modules are connected with BizTalk Accelerator for SWIFT (A4SWIFT) and pre-built for reusing in SWIFT scenario. SWIFT modules use Core modules. Requires A4SWIFT and BizTalk SWIFT adapters installed. (not covered as part of this post)
-
Tracking modules – these module provide enhanced tracking capabilities over ESB and can be installed independently of other modules. They require the BAM infrastructure.
-
Dashboard – modules for presenting Silverlight experience for working with Dashboard capabilities and configuration model. Independent of other modules.
Following Figure present the relation of all FMSB modules.
Figure4: Core + Tracking + Dashboard modules with configuration stores
Need for rich BI within ESB
Like an ocean surrounding an iceberg, business performance management (BPM) provides the business context for performance dashboards, which are layered applications built on a business intelligence and data integration infrastructure (i.e., the base of the iceberg). The most visible elements of a performance dashboard are the scorecard and dashboard screens, which display performance data using leading, lagging, and diagnostic metrics.
In custom implementation extracting relevant business data for Dashboard isn’t an easy task. By using ESB architecture ESB runtime (Dispatcher in messaging scenario and Advance method in Orchestration scenario) has a full control of every message flow inside ESB runtime. But, even with all this knowledge ESB2.0 doesn’t provide full tracking feature. With pure ESB runtime you can’t extract reports which give you answers on common questions:
In any financial services application, it is very common to provide an answer to questions like the following:
-
How many payments have been processed today?
-
How were today’s payments cleared?
-
Domestic vs cross-border?
These are the main reasons why we enhanced the tracking capability of ESB toolkit.
Enriched ESB runtime (with FMSB assemblies „..V1.dll“) now has a capability to extract data by using new BAM interceptor. These data include:
-
Itinerary data (start time, end time, name, version)
-
Service data (start time, end time, business name, status,…)
-
KPI inside Message body (user configure)
Interceptor will extract Itinerary and Service data from Itinerary header. KPI inside Message body would be extracted according to the configuration model and stored into BAM.
Administration of the system would define which itineraries and services should be tracked (ESB Itinerary DSL model), how to extract KPIs from message body, which services/itineraries and define tracking entity (Activity with Checkpoints analogy from BAM). See the screenshot below
With FMSB, configuration of KPIs isn’t done inside Excel (nor custom XML). Administrator of the system (or business person) could use Dashboard with Drag/Drop functionality to define all necessary data (Activities, Checkpoints, Cubes, Measures, Dimensions) together with service position where this data should be tracked.
This model is published in:
-
Configuration model for tracking
-
BAM star schema to persist tracked data.
During the runtime tracking Interceptor would read Configuration model and extract data from Message body as defined.
Dashboard presents visualization of the cubes inside SQL Analysis services. This is generic tool and could be re-used for any cube inside Microsoft SQL Analysis services.
-
Sources – Cubes from SQL Analysis services (OrderDocumentSource)
-
Measures – Defined measures for selected Cube (CountOf)
-
Dimensions – Defined Dimensions for selected Cube (CustomerName, RequestType)
-
Filter – Dimension for filtering (same as Dimension).
Dashboard provides several pre-defined type of reports (Column, Line, Pie, Bar, Area, Doughnut, Point, StackedArea) for any source. Following is the sample of Column report:
By selecting different type of report view would be redrawn with the same data.
FMSB installation creates BAM cubes for:
- Storing Itinerary/Services
Those cubes provides source data for report like bellow (percentage of service execution):
- Storing Itinerary/Services as Real Time Aggregation for live service view on the system
LiveData view present IT real view on the system. See the screenshot below for details
LiveData presents:
-
Current Itineraries working status on the system – „How many itineraries currently working?“
-
Current Itineraries status – „Status of itineraries on the system?“
-
Current working services status – „How many services currently working ?“
Note: BAM system store data into BAM RTA Cubes with delay.
The above data provides great insight to IT administration to know exactly what the current system/service/itinerary load is.
Important Note: The Tracking architecture extension and the dashboard feature in FMSB are designed to be generic and can be used for any BizTalk ESB toolkit implementation. It is not restricted to financial services vertical. If the BizTalk implementation does not warrant the need for ESB toolkit the dashboard can still be used to view BAM data more visually.
Conclusions
FSMB provides great set of ESB add-ons. With core functionalities benefits are available either for developers or for business persons or for solution architect. By re-using ESB and BizTalk runtime FMSB provides solid foundation for any specific domain development.
by community-syndication | Sep 20, 2010 | BizTalk Community Blogs via Syndication
How should I design my environment? What OS version? SQL Edition? BizTalk license? Etc. Etc. I get these questions frequently.
The only one true answer to this question is the architects favorite – “it depends”. And once you know the requirements – some of the things on which it depends – it will still be closely followed by its companion: “We need to test to know”.
Still, I think everyone has their favorite configuration – that they then add or deduct from based on the requirements. I do. This is how it goes.
Servers
Four. Two SQL, Two BizTalk.
Why? High availability for SQL and BizTalk. Load balancing on BizTalk machines.
OS
Windows Server 2008 (R2) Enterprise, on all machines.
Why? Clustering. Plain and simple.
SQL Edition
SQL Server 2008 (R2) Standard, on the SQL boxes.
Why? Off the BizTalk environments I have worked with they have only very seldom gone beyond two machines which is the only real limitation with Standard that I care about. I know of limitations to RTA in BAM and of performance gains with Enterprise, and sometimes that may be required – but not as a baseline.
SQL Instances
Four SQL Server Instances: BizTalkMgmt, DTA, BAM, MsgBox.
Why? Prepare for and maximize scale-out possibility. Simplify IO division. Help with memory reservation.
SQL IO
Three disks per instance: Data, Log and TempDb. Baseline is 40, 20, 15 GB. Varies with requirements.
SAN if available.
Why? Disks are un-expensive. IO is core to SQL. SQL is core to BizTalk.
BizTalk Edition
BizTalk Server 2009/2010 Enterprise
Why? Number one reason – you want to be able to go beyond a single server: Because you want load balancing and high availability.
Virtualization
Not in my baseline.
Why? Could be a requirement with certain customers and it certainly works, but I would recommend physical machines because I think it gives more bang for the buck. BizTalk can many times be a processor, memory and IO intensive application.
Processor
Quad cores for sure, Hexa or Octo if availability permits. One proc per server is enough with this amount of cores as a baseline. Requirements like high throughput messaging and processing may cause it to rise.
Why? Same as above. Higher ROI with multi-core.
Memory
4 GB minimum for a 64-bit OS, preferably 8GB or more total memory on BizTalk Servers.
At least 16GB on the SQL machines.
Why? Memory is a cheap commodity right now. Not the right place to be cheap.
Summary
The above is in no way thorough. It wasn’t meant to be. There is no “One Truth”. I stress that I call it a Baseline. It was meant to be a brief overview. It’s based on the most common questions and the most common requirements for my customers. Consider your own requirements. Mine might not match yours. “It depends”
Input
What’s your baseline? Where does it differ? Where have you drawn the same conclusions?
by community-syndication | Sep 20, 2010 | BizTalk Community Blogs via Syndication
The goal of this blog is to dig deeper into cache client & server communication, provide more insights into a set of configuration knobs and conclude with some best practices recommendation.
Introduction
If you are reading this blog, chances are that you are reasonably deep into AppFabric Cache, previously known as Velocity. If not, here is a quick 200 level summary with some useful links:
AppFabric Cache is Microsoft ‘s distributed caching solution. It is part of Windows Server AppFabric, and is available as an out of band release on Windows Server. You can get more information from http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx
Here are a set of scenarios for using a distributed cache:
- Improving performance of your application
- Reducing load on and scaling out the database tier
- ASP.NET session store repository
- Centralized in-memory repository for data shared by a set of services
Data suitable for caching can be broadly classified as:
-
Reference data: readonly / infrequently changing data shared by all users. Eg: catalog data
-
Activity data: read and write data, single user. Eg: shopping cart
-
Resource data: read and write data, shared by all users. Eg: airline tickets
Background
AppFabric Cache has 3 modes of installation – cache client, caching services and admin. When you install the cache service on a machine, there is a configuration phase for setting up a configuration store (XML file based or SQL Server or custom provider). When a set of cache servers is configured to point to the same configuration store, they constitute a cache cluster. AppFabric transparently manages the entire cluster – load balancing of data, data partitioning map, replication of data, availability of cache servers etc. Any .NET based cache client can reference the installed client DLLs and with the choice of config and/or code start using the cluster. The cache client would need access to at least one cache server, from which it would get the list of all the servers in the cluster. Objects can be stored and retrieved from the cache cluster using simple APIs. The term ‘client’ in this context may be misleading, it is from a cache usage perspective. It can actually be a .NET service that hosts business logic or an ASP.NET web application. The term usage is analogous to the same service being referred to as ‘SQL client’.
Cache Client – Server communication
The communication between the cache servers and cache clients uses the WCF channel model and net.Tcp binding. Cache Servers use the 22233 (default) TCP port for communicating with the cache client. There are some additional cache ports for more cache cluster functionality. In this context, there are several configuration knobs that will be useful to understand:
- ChannelOpenTimeOut: wait time for a cache client to establish a network connection with the cache server
- RequestTimeOut: wait time for a cache client to complete the cache operation and process the response.
- MaxConnectionsToServer: specifies the number of channels that are opened from the cache client to the cache server(s)
Test scenario
We will have a simple .NET application that will instantiate the DataCacheFactory object, get a reference to the default cache, store a <key, value> and then retrieve the value. The application is running on CACHECLIENT-MACHINE and the cache server is running on CACHESERVER-MACHINE. In this case, we have a 1 node cache cluster.
Tools setup
We will use tracelog to capture the ETW events on CACHECLIENT-MACHINE as part of this communication. You can download the tracelog utility which is part of the Windows Software Development Kit.
Note: The Tracelog.exe file is not included with Windows SDK for Windows Server 2008 and the Microsoft .NET Framework 3.5. Therefore, install the Windows Vista SDK on Windows Server 2008.
Test Execution and Capturing Results
Now, let us run tracelog to start a session named ‘debugtrace’. The output will be stored in test.etl
C:\test>tracelog -start debugtrace -f test.etl -guid “c:\Windows\system32\AppFabric\Manifests\ProviderGUID.txt” -level 5 -cir 512
Note: If you have issues in accessing the ProviderGUID.txt, copy it to another folder and retry the command.
Then let us execute the following piece of code:
public
static
DataCacheFactory myCacheFactory;
DataCache cache;
List<DataCacheServerEndpoint> servers = new
List<DataCacheServerEndpoint>(1);
string srvName = “CACHESERVER-MACHINE”;
servers.Add(new
DataCacheServerEndpoint(srvName, 22233));
DataCacheSecurity security = new
DataCacheSecurity(DataCacheSecurityMode.None, DataCacheProtectionLevel.None);
DataCacheClientLogManager.ChangeLogLevel(System.Diagnostics.TraceLevel.Off);
//Create cache configuration
DataCacheFactoryConfiguration configuration = new
DataCacheFactoryConfiguration()
{
Servers = servers,
LocalCacheProperties = new
DataCacheLocalCacheProperties(),
SecurityProperties = security,
MaxConnectionsToServer = 1
};
myCacheFactory = new
DataCacheFactory(configuration);
Console.WriteLine(“Connected to {0}”, srvName);
Console.ReadLine();
cache = myCacheFactory.GetDefaultCache();
Console.WriteLine(“Simple PUT GET starts”);
cache.Put(“test”, new
object());
object foo = cache.Get(“test”);
Console.WriteLine(“Simple PUT GET ends”);
Console.ReadLine();
Here is the output from the application:
Now let us stop the trace collection.
C:\test>tracelog -stop debugtrace
NOTE: ETW tracing data is not localized in the V1 release. This analysis is based on the format and event data relevant to the V1 release.
Analyzing the output
Now, let us open test.etl from Event Viewer and analyze some of the entries. Let us split the entries into the following areas:
DataCacheFactory creation
- DRM instance created.
- Creating channel for [net.tcp://CACHESERVER-MACHINE:22233]
- channel for [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 36610825.
- Channel open succeeded – [Endpoint=[net.tcp://CACHESERVER-MACHINE:22233]; Lockstatus=12; ChannelState=Opened; Status=ChannelOpening]
Accessing the cache
- GetCache: Creating the Named Cache ‘default’
- GenericCache: Constructing Cache: default
- Initialize: Completed
- 1:-1′ GET_NAMED_CACHE_CONFIGURATION;Routed;default;;;;Version = 0:0 – Request saved for correlation.
- ‘1:-1’ GET_NAMED_CACHE_CONFIGURATION;Routed;default;;;;Version = 0:0 – Sending request to [net.tcp://CACHESERVER-MACHINE:22233].
- Message sent to [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 36610825.
- ‘1:-1’ GET_NAMED_CACHE_CONFIGURATION;Routed;default;;;;Version = 0:0 – Send result – Status=Success.
- ‘1:-1’;Ack;UNINITIALIZED_ERROR – Response got from remote DOM.
PUT Operation
- SendReceive: Begin: ‘2:-1’ PUT;Routable;default;;;test;Version = 0:0
- SendMsgAndWait: Serializing Object: msgId = 2
- ‘2:-1’ PUT;Routed;default;Default_Region_0760;1043303394;test;Version = 0:0 – Starting to process.
- ‘2:-1’ PUT;Routed;default;Default_Region_0760;1043303394;test;Version = 0:0 – Destination – [net.tcp://CACHESERVER-MACHINE:22233].
- Message sent to [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 36610825.
- ‘2:-1’;Ack;UNINITIALIZED_ERROR – Response got from remote DOM.
- SendReceive: Request’s 2 response’s status is Ack : ErrorCode=UNINITIALIZED_ERROR
GET Operation
- SendReceive: Begin: ‘3:-1’ GET;Routable;default;;;test;Version = 0:0
- SendMsgAndWait: Begin: msgId = 3
- ‘3:-1’ GET;Routed;default;Default_Region_0760;1043303394;test;Version = 0:0 – Starting to process.
- ‘3:-1’ GET;Routed;default;Default_Region_0760;1043303394;test;Version = 0:0 – Destination – [net.tcp://CACHESERVER-MACHINE:22233].
- ‘3:-1’ GET;Routed;default;Default_Region_0760;1043303394;test;Version = 0:0 – Sending request to [net.tcp://CACHESERVER-MACHINE:22233].
- SendMsgAndWait: Request is Pending, msgId = 3
- ‘3:-1’;Ack;UNINITIALIZED_ERROR – Response got from remote DOM.
- ‘3:-1’ GET;Routed;default;Default_Region_0760;1043303394;test;Version = 0:0 – Request completed on response – ‘3:-1’;Ack;UNINITIALIZED_ERROR.
- MyCallback: Begin Processing Response
- ‘3:-1’;Ack;UNINITIALIZED_ERROR – MyCallback: End Processing Response
- SendMsgAndWait: DeSerializing Object, msgId = 3
Summary
- Serialization of the object happens on the cache client in a PUT operation (Step 2) and de-serialization happens on the cache client in a GET Operation (Step 11)
- Responses are processed asynchronously using I/O threads.
- Instantiation of a DataCacheFactory object includes a set of policy settings to control Local cache, ChannelOpenTimeout, RequestTimeout, Security etc settings as seen from the code snippet above. The instantiation creates a set of internal data structures (DRM, ThickClient).
- There was 1 DataCacheFactory used in this sample. This can be found in the event trace which shows only 1 ‘DistributedCache.ClientChannel.Client1’ instance. Here is an extract from our trace collection.
|
Source
|
DistributedCache.ClientChannel.Client1
|
|
Param
|
Client channel opened.
|
- maxConnectionsToServer was set to 1. This can be found out from the event trace which shows only 1 channelID being used. (ChannelID = 36610825). This can also be validated by looking at the perfmon counter ‘TCPv6:Connections Established’ which shows the connections established from this machine.
|
Source
|
DistributedCache.ClientChannel.Client1
|
|
Param
|
Message sent to [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 36610825
|
- Changing maxConnectionsToServer = 3 in the code snippet above, collecting and analyzing the trace data now shows the additional ChannelIDs part of the same DataCacheFactory instance
|
Source
|
DistributedCache.ClientChannel.Client1
|
|
Param
|
channel for [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 36610825
|
|
Source
|
DistributedCache.ClientChannel.Client1
|
|
Param
|
channel for [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 62130720
|
|
Source
|
DistributedCache.ClientChannel.Client1
|
|
Param
|
channel for [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 4593845
|
- Increasing the number of DataCacheFactories to 2 and maintaining maxConnectionstoServer=3 in our sample, let us collect the trace once again. Now we can see 2 clients for the DataCacheFactory instances (with the internal DRM , ThickClient objects) and each of them having 3 channels created, so 6 in total.
|
Source
|
DistributedCache.ClientChannel.Client2
|
|
Param
|
channel for [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 61325552
|
|
Source
|
DistributedCache.ClientChannel.Client2
|
|
Param
|
channel for [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 29028787.
|
|
Source
|
DistributedCache.ClientChannel.Client2
|
|
Param
|
channel for [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 36610825.
|
|
Source
|
DistributedCache.ClientChannel.Client1
|
|
Param
|
channel for [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 35885827.
|
|
Source
|
DistributedCache.ClientChannel.Client1
|
|
Param
|
channel for [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 37710717.
|
|
Source
|
DistributedCache.ClientChannel.Client1
|
|
Param
|
channel for [net.tcp://CACHESERVER-MACHINE:22233] ChannelID = 7995840.
|
This can also be validated from perfmon by looking at the set of connections established which shows the increase in 6. Here are the before and after snapshots.
Before
After
Best Practice Recommendation
- Even though having just 1 cache server in the client config would suffice, it is recommended to maintain as many cache server hostnames in the config file. *When a cache client connects to one of the cache servers, it gets the routing table which has the partitioning logic to access other cache servers. Including more cache servers helps with more resiliency for the initial connection. If the logic is implemented in code, building a host lookup service will work better.
- Instantiating a DataCacheFactory object creates several internal data structures (DRM, ThickClient), minimizing the number of DataCacheFactories and creating them in advance (on a separate thread) is recommended. A singleton pattern should work for most scenarios; do not create one DataCacheFactory object per cache operation. When you need to have different policy settings, for example, if local cache is required only for a set of named caches, then having different DataCacheFactory objects will be appropriate.
- Default setting for ChannelOpenTimeout is 15 seconds, you can set it to much lower values if you want the application to fail fast while opening the channel.
- Default setting for RequestTimeout is 10 seconds, do not set it to 0. If you do, your application will see a timeout on every cache call. Changes to the default value need to take into account the workload and physical resources (client machine configuration, cache server configuration, network bandwidth, object size, ratio of GETs Vs PUTs, number of concurrent operations, usage of Regions, etc).
-
Setting maxConnectionsToServer=1 (default) will work in most situations. In scenarios, when there is a single shared DataCacheFactory and a lot of threads are posting on that connection, there may be a need to increase it. So if you are looking at a high throughput scenario, then increasing this value beyond 1 is recommended. Also, be aware that if you had 5 cache servers in the cluster, if the application uses 3 DataCacheFactories and if maxConnectionsToServer=3, from each client machine there would be 9 outbound TCP connections to each cacheserver, 45 in total across all cache servers.
Note: There will be a set of subsequent blogs for explaining capacity planning and debugging timeouts which will provide more details on the usage of these configuration knobs.
by stephen-w-thomas | Sep 20, 2010 | Stephen's BizTalk and Integration Blog
In early September 2010, I got the honor to present three sessions on AppFabric and Workflow 4.0 to the BizTalk Users Group in Sweden at the European BizTalk Conference. While my sessions were not related to BizTalk, they are designed to show how easy it is for someone with BizTalk skills to learn AppFabric and Workflow 4.
I have posted the session slide decks and sample code (including the code generated from my 100% LIVE demo).
I did three sessions:
- Server AppFabric and Workflow 4.0 Overview – This includes some slides on AppFabric strengths and weakness compared to BizTalk and shows how simple it is to set up Correlation in Workflow 4.
- Server AppFabric with Human Workflow – This uses SharePoint 2010 and Workflow 3.5 with AppFabric and .Net 4 Workflow (Chapter 10 from my book) to allow data to be corrected and resubmitted to the same workflow process.
- Platform AppFabric with Remote Message Broadcasting – This talks about using Azure Platform AppFabric to broadcast messages through the Service Bus to destinations on numerous networks (Chapter 11 from my book).
The video recording of the sessions should be available soon and I’ll post the links once I have them.
by community-syndication | Sep 20, 2010 | BizTalk Community Blogs via Syndication
The scene looks like this – while teaching a SharePoint 2010 class I
decided to build a Feature that used one of the OOTB Service Applications of SharePoint
2010.
I decided to create a PDF Converter ’Feature’ that used the Word Automation Services
hosted in SharePoint 2010. Looking into the Word Automation Services, I’d say that
if you’ve already got a PDF creation process going, then stick with it as it appears
this service is pretty simple. However if you’ve got nothing, then Word Automation
Services will be great!
(Having spent a previous life in a graphics company, there are many options that go
with creating just that perfect PDFI could find none of these here :()
(yes the pdf icon needs work)
So I created a VS.NET 2010 Solution with a Feature.
The PDFConverter.cs is where the crux of the work is – the rest of
the solution is working out just the right spot to call it.
Couple of Interesting Points about the Solution
1. ScriptLink – using this from a CustomAction within an Elements
file allows to inject Script into a site where the Feature is Activated. There is
also ScriptBody that allows you to inject script code right there.
2. RegistrationType – being declared as a FileType, currently this
will work with docx. Feel free to experiment and extend out.
Also, seeing this action is activated on a list item, we need to track what list it
came from {ListId} and the item in that list {ItemId} which
is an integer.
1 <Elements
xmlns="http://schemas.microsoft.com/sharepoint/"> 2 <CustomAction
Id="MicksPDFScript" 3 ScriptSrc="~site/_layouts/WordAutomationServices/Scripts/MoveItMoveIt.js" 4 Location="ScriptLink"> 5 </CustomAction> 6 7 <CustomAction
Id="MicksPDFConverter" 8 RegistrationType="FileType" 9 RegistrationId="docx" 10 Location="EditControlBlock" 11 Sequence="106" 12 Title="Convert
to PDF" 13 ImageUrl="~site/_layouts/WordAutomationServices/Images/pdf.gif" 14 > 15 <UrlAction
Url="javascript:MicksOpenDialog('{ListId}','{ItemId}');"/> 16 </CustomAction> 17 18 </Elements> 19
3. Code that actually does the work – is pretty simple really with Folders
and entire Document Libraries able to be passed to the Conversion Job.
One annoying thing is that below in Line15, conversionJob.Start() is
called, really a job gets created and added to the Job Timer queue. Regardless of
what goes on, the Started property always returns true.
Typically I’ve found the Timer Job to kick in every 5 mins to process the conversions
and eventually a PDF file is seen in the library.
1 public bool Convert(string srcFile,string dstFile) 2 { 3 4 //create
references to the Word Services. 5 var
wdProxy = (WordServiceApplicationProxy)SPServiceContext.Current.GetDefaultProxy(typeof(WordServiceApplicationProxy)); 6 var
conversionJob = new ConversionJob(wdProxy); 7 8 conversionJob.UserToken = SPContext.Current.Web.CurrentUser.UserToken; 9 conversionJob.Name = "Micks
PDF Conversion Job " + DateTime.Now.ToString("hhmmss"); 10 conversionJob.Settings.OutputFormat = SaveFormat.PDF; 11 conversionJob.Settings.OutputSaveBehavior = SaveBehavior.AlwaysOverwrite; 12 13 conversionJob.AddFile(srcFile,
dstFile); 14 15 conversionJob.Start(); 16 return (conversionJob.Started); 17 18 }
A couple of screen shots in action:
Of course this is not production ready, but it should give you a great start in getting
there. To start, simply install and Activate the Feature on a site collection to see
the functionality.
Go to a document library and activate the item drop down to see the Convert
to PDF option. Must be a DOCX file currently.
Grab the VSNET2010 Solution and go for it – have fun.
by community-syndication | Sep 20, 2010 | BizTalk Community Blogs via Syndication
Two weeks before submitting the final copy of my latest book, I reran all my chapter demonstrations that had been built during the year. Since many demos were written with beta versions of products, I figured I should be smart and verify that everything was fine with the most recent releases. But alas, everything was […]
by community-syndication | Sep 19, 2010 | BizTalk Community Blogs via Syndication
As part of the Windows Azure AppFabric September Release we are now providing both 32- and 64-bit versions of the Windows Azure AppFabric SDK.
In addition to addressing several deployment scenarios for 64-bit computers, Windows Azure AppFabric now enables integration of WCF services that use AppFabic Service Bus endpoints in IIS 7.5, with Windows® Server AppFabric. You can leverage Windows® Server AppFabric functionality to configure and monitor method invocations for the Service Bus endpoints.
Note that the name of the installer has changed:
· Old Name:
WindowsAzureAppFabricSDK.msi
· New names:
WindowsAzureAppFabricSDK-x64.msi
WindowsAzureAppFabricSDK-x86.msi
Any automated deployment scripts you might have built that use the previous name will need to be updated to use the new naming. No other installer option has changed.
The Windows Azure AppFabric SDK September Release is available here for download.
The Windows Azure AppFabric Team
by community-syndication | Sep 19, 2010 | BizTalk Community Blogs via Syndication
The other day I had a need to create many word documents in code and publish them
up to a SharePoint 2010 site.
1 static void Main(string[]
args) 2 { 3 int iMAXDocs = 200; 4 string fpath = Path.Combine(Directory.GetCurrentDirectory(), "Docs"); 5 Directory.CreateDirectory(fpath); 6 Console.WriteLine("Path
created"); 7 for (int i = 0;
i < iMAXDocs;
i++) 8 { 9 string docname = Path.Combine(fpath, "Doc" + i.ToString() + ".docx"); 10 CreateWordDoc(docname); 11 Console.WriteLine("Created
Doc {0} of {1}",
i, iMAXDocs); 12 } 13 14 }
So essentially it went something like thatwith the key really being line#10 – CreateWordDoc().
The CreateWordDoc routine also adds a couple of custom String properties to the document.
1 private static void CreateWordDoc(string docname) 2 { 3 using (WordprocessingDocument
package = 4 WordprocessingDocument.Create(docname,
WordprocessingDocumentType.Document)) 5 { 6 // Add
a new main document part. 7 package.AddMainDocumentPart(); 8 9 // Create
the Document DOM - which could be from a template XML file or so. 10 package.MainDocumentPart.Document = 11 new Document( 12 new Body( 13 new Paragraph( 14 new Run( 15 new Text("Hello
World!"))))); 16 17 //add
props. 18 CustomFilePropertiesPart
pt = package.CustomFilePropertiesPart; 19 if (pt==null) 20 pt = package.AddCustomFilePropertiesPart(); 21 22 XmlDocument
xdoc = new XmlDocument(); 23 xdoc.LoadXml("<Properties
xmlns='http://schemas.openxmlformats.org/officeDocument/2006/custom-properties' " 24 + "xmlns:vt='http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'>" 25 + "<property
fmtid='{D5CDD505-2E9C-101B-9397-08002B2CF9AE}' pid='2' name='temp'> " 26 + "<vt:lpwstr>Done
in Open XML</vt:lpwstr>" 27 + "</property>" 28 + "<property
fmtid='{D5CDD505-2E9C-101B-9397-08002B2CF9AE}' pid='3' name='micksdemo'>" 29 + "<vt:lpwstr>SharePoint
is Cool</vt:lpwstr>" 30 + "</property>" 31 + "</Properties>"); 32 33 //save
the props 34 xdoc.Save(pt.GetStream()); 35 36 // Save
changes to the main document part. 37 package.MainDocumentPart.Document.Save(); 38 39 } 40 }
>
All in all pretty straight forward using OpenXML Format SDK 2.0
Here’s the VS.NET2010 Solution of the above code –
by community-syndication | Sep 19, 2010 | BizTalk Community Blogs via Syndication
I had a great (if not short) time at SharePoint Saturday LA – wish I could have spent
more time.
If you came to my session on Workflow and SharePoint – here are my
demos
(383.72 KB) and slides
(1.51 MB)
Check out my new book on REST.
by community-syndication | Sep 19, 2010 | BizTalk Community Blogs via Syndication
For a developer Windows Azure is an opportunity. But it is also an obstacle. It represents a new learning curve much like the ones presented to us by the .NET framework over the last couple of years (most notably with WF, WCF and WPF/Silverlight). The nice things about it though is that it’s still .NET (if you prefer). There are new concepts – like “tables”, queues and blobs, web and worker roles, cloud databases and service buses – but, it’s also re-using those things we have been working with for numerous years like .NET, SQL, WCF and REST (if you want to).
You might hear that Azure is something that you must learn. You might hear that you are a dinosaur if you don’t embrace the Windows Azure cloud computing paradigm and learn its APIs and Architectural patterns.
Don’t take it literally. Read between the lines and be your own judge based on who you are and what role you hold or want to achieve. In the end it comes down to delivering business value – which often comes down to revenue or cost efficiency.
For the CxO cloud should be something considered. For the architect, Azure should be something grasped and explored. For the Lead Dev, Azure should be something spent time on. For the Joe Devs of the world, Azure is something that you should be prepared for, because it might very well be there in your next project and if it is – you are the one that knows it and excels.
As far as developers embracing Windows Azure I see a lot of parallels with WCF when that launched. Investments were done in marketing it as the new way of developing (in that case primarily services or interprocess communication). At one point developers were told that if they were not among the ones who understood it and did it, they were among the few left behind. Today I see some of the same movement around Azure, and in some cases the same kind of sentiment is brought forward.
I disagree. Instead my sentiment around this is: it depends. Not everyone needs to learn it today. But you will need to learn it eventually. After all today, a few years later – Who among us would choose asmx web services over WCF today? Things change. Regardless of how you feel about it. Evolution is funny that way.
Because of the development and breadth of the .NET Framework together with diverse offerings surrounding it a wide range of roles are needed. In my opinion the “One Architect” no longer exists. Much the same with the “One Developer”. Instead the roles exists for different areas, products and technologies – in and around .NET. Specialization has become the norm. I believe Azure ads to this.
I give myself the role of architect (within my field). Though I would no sooner take on the task of architecting a Silverlight application than my first pick of on boarding a new member in our integration team would be someone that has been (solely) a Silverlight developer for the last couple of years.
How is Azure still different though? Azure (cloud) will (given time) affect almost all of Microsoft’s (and others) products and technologies (personal opinion, not quoting a official statement). It’s not just a new specialization – it will affect you regardless of your specialization.
You have to learn. You have to evolve. Why not start today?