by community-syndication | Jun 8, 2005 | BizTalk Community Blogs via Syndication
Yesterday some customers told me that they were suffering from “Completed with discarded messages” in an orchestration using the sequential convoy. They asked me how to solve.
I heard from other customer about the same issue last year. I think it is the one of the most frequent problems customers encounter when they use the “convoy” for the first time.
You can find a great article about the issue, “Completed with discarded messages”, from here. The post wrote the cause of the problem into 3 categories. The case I heard yesterday could be categorized into the 2nd one, which is “Sequential convoys with non-deterministic endpoints”.
Anyway, I wrote a sample code for the customer as following:
The basic idea is very simple. The customers can insert their orchestration into “Foo Process Msg”, The listen shape of “Check Msg for preventing it from being discarded” checks the work queue again before termination. It could prevent the message, which has arrived while processing the customer’s logic, from being discarded. And you can find the sample code here.
Thanks,
Young
by community-syndication | Jun 8, 2005 | BizTalk Community Blogs via Syndication
I just posted a pretty cool sample of how you could call a map dynmically in C#. Very nice. However, it has a drawback (besides being officially unsupported).
Specifically, the way I used TransformBase in the sample will result in regenerating a dynamic assembly for the xslt every time the code is executed. We’d run out of memory very quickly.
Here’s the solution. One of our engineers, Yossi Levanoni, created the Metadata classes that basically cache everything there is to cache for any of the XLANG artifacts, including maps.
By replacing these lines of code:
Assembly mapAssembly = Assembly.LoadWithPartialName(“EAISchemas”);
Type mapTypeClass = mapAssembly.GetType(“EAISchemas.MapToReqDenied”);
TransformBase map = (TransformBase)System.Activator.CreateInstance(mapTypeClass);
XslTransform transform = map.Transform;
XsltArgumentList argList = map.TransformArgs;
With this :
using Microsoft.XLANGs.RuntimeTypes;
XslTransform transform = TransformMetaData.For(typeof(EAISchemas.MapToReqDenied)).Transform;
XsltArgumentList argList = TransformMetaData.For(typeof(EAISchemas.MapToReqDenied)).ArgumentList;
Will result in the maps being pulled from our Cache rather than from the Assembly each and every time….
Pretty cool stuff!
by community-syndication | Jun 8, 2005 | BizTalk Community Blogs via Syndication
I’ve been playing around with a funny error message in ConfigFramework. It says “The Operation Completed Successfully“, but it’s a Retry/Cancel message box, where you get looped until you press cancel… The details found in the log file talk about failiure to modify a COM+ Application. It also happened to a colleage, as he has posted more details in his eXtreme.NET blog.
I solved it changing the identity of MSDTC to the Network Service system identity and restarting MSDTC (I also relaxed the security allowing remote administration of MSDTC, but I’m not sure if it helped). Anyways, I think you can change these settings back to the old values after running ConfigFramework, since the error is about creating and configuring the COM+ App, not about running it.
update: this “The operation completed successfully” translates to “Connection with the transaction manager was lost”. So it’s in deed a problem of servers communicating via MSDTC. My concrete case is due to use local accounts for MSDTC identity in a workgroup environment, so the servers cannot authenticate each other. This case is documented in Bug: MSDTC Fails to Mutually Authenticate
Helpful articles: in case you want more documentation:
New DTC Functionality in Windows Server 2003 SP1
FIX: The SqlConnection.Open function generates a ComException error message if the Distributed Transaction Coordinator (DTC) service is restarted or failed over
Turning Off Remote Procedure Call Security on Windows 2003 Server
Here’s the pic, just for curious ones:
by community-syndication | Jun 7, 2005 | BizTalk Community Blogs via Syndication
Every wonder how you could possibly reuse the XSLT that we store in BizTalk maps? Every wonder how you could pick and chose which map to execute in your code from the compiled BizTalk Assembly. Well there is a way! The type containing the map xslt is devired from TransformBase contained in Microsoft.XLANGs.BaseTypes. We can use that object to extract the xslTransform and the xslArgumentList objects from the BizTalk Map Type residing in the assembly and pass them to TransformMessage. Pretty cool. This allows you to resuse BizTalk maps and call them dynamically as you see fit. For example, imagine the case of dynamic send ports where you also need to determine the map execution model dynamically or through a set of rules. Remember though, this is completely Unsupported by Microsoft.
I put together a simple project from the shipped EAISolutions tutorial. I added the EAIUtilies project to it which has the code for this. This code is then called within a message assignment shape within the EAIOrchestration project to create a new message from the executed map. Thanks Ashwani for helping me troubleshoot.
Download the project ..Check it out..
sing System;
using System.Xml;
using System.Xml.Xsl;
using Microsoft.XLANGs.BaseTypes;
using System.Reflection;
using System.IO;
using System.Text;
using System.Xml.XPath;
namespace EAI.Utilities
{
/// <summary>
/// Summary description for Class1.
/// </summary>
[Serializable()]
public class MapHelper
{
public MapHelper()
{
}
public static XmlDocument GetMappedDoc(Microsoft.XLANGs.BaseTypes.XLANGMessage msg)
{
XmlDocument xmlDocOutputMsg = new XmlDocument();
XmlDocument xmlDocInputMsg = null;
try
{
xmlDocInputMsg = (XmlDocument)msg[0].RetrieveAs(typeof(XmlDocument));
Assembly mapAssembly = Assembly.LoadWithPartialName(“EAISchemas”);
Type mapTypeClass = mapAssembly.GetType(“EAISchemas.MapToReqDenied”);
TransformBase map = (TransformBase)System.Activator.CreateInstance(mapTypeClass);
XslTransform transform = map.Transform;
XsltArgumentList argList = map.TransformArgs;
xmlDocOutputMsg = TransformMessage(transform,argList,xmlDocInputMsg);
}
catch (Exception exc)
{
System.Diagnostics.EventLog.WriteEntry(“mapHelper”,exc.InnerException.ToString());
}
return xmlDocOutputMsg;
}
private static XmlDocument TransformMessage(XslTransform xslt,XsltArgumentList args,XmlDocument sourceDoc)
{
XmlNodeReader sourceRoot=new XmlNodeReader(sourceDoc);
XPathDocument srcXPath=new XPathDocument(sourceRoot);
MemoryStream stm = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(stm,System.Text.Encoding.Unicode);
xslt.Transform(srcXPath,args,writer,null);
stm.Flush();
stm.Seek(0,SeekOrigin.Begin);
XmlTextReader destReader;
XmlDocument destDoc;
try
{
destReader= new XmlTextReader(stm);
destDoc = new XmlDocument();
destDoc.Load(destReader);
return destDoc;
}
finally
{
}
}
}
}
by community-syndication | Jun 7, 2005 | BizTalk Community Blogs via Syndication
The chance that you receive this error for the same reason as I may be slim, but I thought I would offer up anyway. If you receive this error, and read the entire error message in the event viewer, it should give an indication of the cause. In my case, this was “no subscribers were found”. Of course I headed to our fried the Subscription Viewer. What I discovered is that when you enlist a dynamic send port, it creates a subscription for every adapter you have registered. In my case I had gotten a little ahead of myself and had deployed a project with an orchestration that made use of a custom adapter that I had registered AFTER deploying the orchestration project. To be safe, I undeployed the orchestration project, registered the adapter, and redeployed the orchestration project. All is good.
Cheers,
Todd
by community-syndication | Jun 7, 2005 | BizTalk Community Blogs via Syndication
Marty Wasznicky has posted a compiled BizTalk 2004 Help File (.chm) check it out in his blog (11 Mb)
The most interesting stuff is that it can be indexed using MSN Desktop Search (as any other .chm file)…. that means querying BizTalk Documentation from the Windows Taskbar. Cool, since I’ve tried to index the Visual Studio Combined Help files without success 🙁
by community-syndication | Jun 7, 2005 | BizTalk Community Blogs via Syndication
There is a new whitepaper on MSDN about messaging. It’s called BizTalk Server 2004: A Messaging Engine Overview, but it’s quite a deep dive into messaging. From my point of view, the most interesting stuff is how it explains the Pub/Sub internals in terms of MessageBox flow and stored procs involved in publishing and subscribing.
by community-syndication | Jun 6, 2005 | BizTalk Community Blogs via Syndication
Done for the night….I’ll post a lot more later this week…
by community-syndication | Jun 6, 2005 | BizTalk Community Blogs via Syndication
Remember, during the course we went over App Domain configuration for BizTalk. The key to creating App Domains with BizTalk, and hence being able to use configuration files with your project is to edit the BTSNTSvc.exe.config file located in the BizTalk program directory. The next key is to make sure you put the right sections in the right spot within the config file, else the BizTalk service will never start again (I ran into this myself once).
Why would you use them? Well, here’s a couple of reasons:
1) It gives you the ability to configure them separately. This is useful for orchestrations that use 3rd party component that read their configuration for the config file and you have different requirements for these 3rd party components when they are used from different orchestrations. You can also specify an assembly search-path on a per-app-domain basis.
2) The unit of code-unloading in .Net is app-domain. If you put separate orchestrations into app-domains there is an opportunity to unload some of them while the rest are still in use. For example, you can put you frequently used orchestrations into a “hot” app-domain and the less-used orchestrations into a “cold” app-domain. The hot app-domain will be continually used. The cold app-domain will get recycled after 25 minutes of idle time. You can control the unloading times with app-domain configuration (see MSDN).
3) It gives you some level of isolation. For example, if you have a singleton object—you’ll actually get one per app-domain—so one orchestration cannot mess the other orchestration’s singleton.
4) Internally, XLANG can use app-domains to host different versions of the XLANG runtime (e.g., Voyager vs. Pathfinder)
Here’s a sample of the edits to the BizTalk config file. Remember, the configSections comes first, and the sections it defines comes last….all the new additions are in RED.
<?xml version=”1.0″ ?>
<configuration>
<configSections>
<section
name=”xlangs”
type=”Microsoft.XLANGs.BizTalk.CrossProcess.XmlSerializationConfigurationSectionHandler, Microsoft.XLANGs.BizTalk.CrossProcess” />
</configSections>
<runtime>
<assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1″>
<probing privatePath=”BizTalk Assemblies;Developer Tools;Tracking;Tracking\interop” />
</assemblyBinding>
</runtime>
<system.runtime.remoting>
<channelSinkProviders>
<serverProviders>
<provider id=”sspi” type=”Microsoft.BizTalk.XLANGs.BTXEngine.SecurityServerChannelSinkProvider,Microsoft.XLANGs.BizTalk.Engine” securityPackage=”ntlm” authenticationLevel=”packetPrivacy” />
</serverProviders>
</channelSinkProviders>
<application>
<channels>
<channel ref=”tcp” port=”0″ name=””>
<serverProviders>
<provider ref=”sspi” />
<formatter ref=”binary” typeFilterLevel=”Full”/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
<xlangs>
<Configuration>
<AppDomains AssembliesPerDomain=”10″>
<DefaultSpec SecondsIdleBeforeShutdown=”5″ SecondsEmptyBeforeShutdown=”5″>
</DefaultSpec>
<AppDomainSpecs>
<AppDomainSpec Name=”MyAppDomain”>
<BaseSetup>
<ConfigurationFile>C:\Projects\Projects\AppDomainConfig\MyAppDomainConfiguration.config</ConfigurationFile>
</BaseSetup>
</AppDomainSpec>
</AppDomainSpecs>
<PatternAssignmentRules>
<PatternAssignmentRule AssemblyNamePattern=”AppDomainConfig.*” AppDomainName=”MyAppDomain” />
</PatternAssignmentRules>
</AppDomains>
</Configuration>
</xlangs>
</configuration>
Lastly, here’s the sample we walked through in class. Yossi Levanoni put this together back in September of 03′.
The sample demonstrates how to instruct the orchestration engine to execute top-level (i.e., not-called) orchestrations from a particular assembly in a particular app domain; then how to specify configuration for this domain. In this sample, a configuration file is associated with the domain. The config file contains a custom configuration section. The test orchestration calls into user code and consumes this custom configuration section. The data is inserted into a flat-file-like XLANG message which is sent to an output folder.
To test it:
1) Compile.
2) Gac/deploy/modify binding.
3) Copy the BTSNTSvc.exe.config to your program files dir. You might want to edit this file so that it points to the correct location for MyAppDomainConfiguration.Config on your machine.
4) Drop any file (it’s just used to start the orchestration) with .xml extension into DataFolders\in.
5) You should see a file with a name like ConfigOut_<guid>.txt generated in DataFolders\out.
6) The contents of the file are:
key=”setting1″ val=”Value1″
key=”setting2″ val=”value two”
key=”setting3″ val=”third value”
Which corresponds to the contents of MyAppDomainConfiguration.config:
<?xml version=”1.0″?>
<configuration>
<configSections>
<section name=”sampleSection”
type=”System.Configuration.SingleTagSectionHandler” />
</configSections>
<sampleSection setting1=”Value1″ setting2=”value two”
setting3=”third value” /> </configuration>
by community-syndication | Jun 6, 2005 | BizTalk Community Blogs via Syndication
I find this very handy for my laptop that does NOT have BizTalk Server 2004 installed on it. Its a compiled version of the online docs….a
convenient chm file. Its updated to SP1. Enjoy.