by community-syndication | Aug 15, 2010 | BizTalk Community Blogs via Syndication
[Source: http://geekswithblogs.net/EltonStoneman]
If you’re doing cross-reference lookups in a BizTalk map you have a few design options (see BizTalk Pattern: Mapping Reference Data), and the BizTalk native XRef lookup can provide lookup caching (see BizTalk XRef Undocumented feature) – and you’ll need caching if your maps runs against large messages.
I prefer not to use the native XRef option because the values are hidden away in the BizTalk schema, are cumbersome to load, and are only available to BizTalk maps. A custom cross-reference implementation is fairly trivial, can be made available to any .NET consumer, and you can control what gets cached and how long the cache lives.
Assuming you have the lookup code in a helper class separate from the map, BizTalk will create a new instance of the helper class for every run of the map. To get the benefit of caching across different calls to the map, you can use a static dictionary of lookup values (see Implement Caching for your BizTalk applications using “static” classes and methods).
The problem with using a static dictionary is that it lives for the duration of the app domain – so the lookup values will be used for every run of the map until the BizTalk host instance is restarted. This is also true for the native Xref cache. Removing stale cache items becomes a manual process, liable to be forgotten.
In a custom implementation you can automate flushing the cache. Monitoring the data source and flushing when it changes is an expensive option, but a cheap alternative is to store the expected lifespan of the cache in configuration, so when the cache reaches the configured age it flushes itself:
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Table Normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:””;
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
mso-pagination:widow-orphan;
font-size:11.0pt;
mso-bidi-font-size:10.0pt;
font-family:”Calibri”,”sans-serif”;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:”Times New Roman”;
mso-bidi-theme-font:minor-bidi;}
<x.y.z.integration.maps>
<caching>
<cache key=“StatusCodeLookup“ lifespan=“P1D“/>
<cache key=“CustomerLookup“ lifespan=“PT10M“/>
</caching>
</x.y.z.integration.maps>
Returning the lookup value then falls into three parts – flush the cache if expired, check the cache, get from source and add to cache if not already present:
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Table Normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:””;
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
mso-pagination:widow-orphan;
font-size:11.0pt;
mso-bidi-font-size:10.0pt;
font-family:”Calibri”,”sans-serif”;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:”Times New Roman”;
mso-bidi-theme-font:minor-bidi;}
public string GetStatusCode(string inputCode)
{
EnsureStatusCode(inputCode);
return _statusCodes[inputCode];
}
private static void EnsureStatusCode(string inputCode)
{
FlushCacheIfExpired();
if (!_statusCodes.ContainsKey(inputCode))
{
string outputCode = GetLookupValue(inputCode);
lock (_syncLock)
{
_statusCodes[inputCode] = outputCode;
}
}
}
private static void FlushCacheIfExpired()
{
TimeSpan lifespan = MapConfiguration.Current.Caching.GetLifespan(CacheConfigKey.StatusCodeLookup);
DateTime expiry = _lastCacheLoad.Add(lifespan);
if (DateTime.Now > expiry)
{
ResetCache();
}
}
Full sample on github here: ConfigurableCrossReferenceCache. (This snippet omits logging and error handling for brevity, but in the sample there’s plenty of both, which makes building and monitoring your cache much easier).
Using BTSNTSvc.exe.config for the configuration means that if you need to change the lifespan of a cache item you’ll need to restart host instances, but if that’s an issue you can use Enterprise Single Sign-On as your configuration store, and lookup the value on every access.
by community-syndication | Aug 15, 2010 | BizTalk Community Blogs via Syndication
I’ve taken my first foray into the world of producing videos with a set for MockingBird. Introduction : Getting up and running with MockingBird V2, using the Web Application and the Configurator Module. WCF Support : How the Console Host works to provide the WCF Support. Understanding MB Configuration: Digging a little deeper into the […]
by community-syndication | Aug 14, 2010 | BizTalk Community Blogs via Syndication
Just wondering how many people actually do dynamic versioning of their BizTalk projects with Cruise Control or Team Build.
The reason I ask is you dont see that many things on the forums or blogs about it. I find that it can be quite challenging at times so Im not sure if we are just doing it the hard way or its something most people dont do?
by community-syndication | Aug 14, 2010 | BizTalk Community Blogs via Syndication
Ive been having some problems with versioning for BizTalk recently and in particular it was centred around one map.
Initially the problems were related to the configuration manager but then when this was resolved there was another little gotcha which is probably worth bearing in mind.
Soon the development machine everything versions as 999.999.999.999 and this is usually pretty pain free. On the build server though a version number is applied from cruise control and replaces anything with 999.999.999.999 with the CCNet version number. Any other version number is not touched incase we are using multiple versions of one of our assemblies.
In the map I was having problems with it always seemed to pick up either an old version or version 0.0.0.0 which was not something that should have existed.
I eventually tracked the problem down the the xml under the map where you find the following snippet referencing your assembly.
<Script Language=”ExternalAssembly” Assembly=”Acme.Utilities, Version=2.5.0.73, Culture=neutral, PublicKeyToken=056df4562600885d” Class=”Acme.Utilities.Mapping.MemberStatusMapping” Function=”Map” AssemblyPath=”..\..Acme.Utilities\obj\Release\Acme.Utilities.dll” />
What is happening is that because its a project reference between the map project and the C# project its popping in the path to the utilities assembly, however when I first created the map I must have been in Release configuration where as for the other maps I must have been in Debug configuration. In the development machine because its always the same version number this problem never shows up, but on the build server the version number changes with each build which makes this visible.
In the server build we do a Debug build and then a Release build. In the above case when we do the Debug build there is nothing in the the release folder so it was then using the 0.0.0.0 version number.
Unfortunately this issue doesnt display itself as a compilation error which is a big pain because you get to the BizUnit tests and find that you get strange failures which are a real problem to troubleshoot andits difficult to track this back to the source of the problem.
Anyway another one which might save someone a few hours
by community-syndication | Aug 14, 2010 | BizTalk Community Blogs via Syndication
Hi all
A couple of days ago I held two presentations at the first meeting in the Danish BizTalk
User Group (DBUG).
The first presentation was about the new mapper in BizTalk 2010.
Find my presentation here:
>
The second presentation was about the Pipeline Component Wizard.
Find my presentation here:
>
Find the code samples for both presentations here:
>
Note that my file names, source code, and so on has “DKBUG” instead of “DBUG” because
the official acronym wasn’t chosen until the meeting, so I guessed and guessed wrong
That’s all, folks!
—
eliasen
by community-syndication | Aug 14, 2010 | BizTalk Community Blogs via Syndication
Perhaps you’re not a gamer, or perhaps you’ve just returned from a stint on the International Space Station or a prolonged exile deep underground, in which case you may be one of the very few people who have not yet heard of Kinect. It is Microsoft’s “game changing” (<groan> my words, apologies to the marketing folks) controller-less controller for the XBox 360, and it will be shipping this November. I had a chance to play with it at the San Diego Microsoft store, and within a few minutes had my credit card out and pre-ordered it and some games. It is VERY VERY cool.
Even though it will not be available until November, the San Diego .NET user group will be hosting a pizza party at the San Diego Microsoft store in September. Our user group members are invited, but we have very limited space. An email will be sent out within the week to our mailing list, and attendance will be on first-registered first-served basis. In addition, we will also be giving priority to people who are paid-up members of the group. If that’s not you, let me take this opportunity to remind you that it’s only $50/year to join, which gets you into all our meetings and opportunities for special events like this. Your membership dues help us fund the group and the meetings, we couldn’t do it without you! In addition, as a federally incorporated 501(c)3 non-profit organization, your dues are tax deductible. Meetings feature world-class speakers, and we also run several specialized SIGs in addition to the main meetings, some 40-ish meetings per year. all for only $50! Details of his event will NOT be posted on our Web site, the only way to get in is to follow the directions in the announcement email, and to register before we run out of available places. As stated, priority will be given to our paid-up supporting members.
If you’re a .NET developer in the San Diego area, please come join our group, and perhaps get a chance to attend this event.
I’d like to thank Andrea and the Microsoft store team for making this possible, it should be a lot of fun!
I’d also like to challenge *anyone* attending to a round of that river rafting game. If you’ve never done it, not to worry, I’ll show you how its done
by community-syndication | Aug 13, 2010 | BizTalk Community Blogs via Syndication
I struggled today to find a good “Getting started with Windows Server AppFabric Cache” tutorial – either my search fu failed me or it simply doesn’t exist. Nevertheless, I was able to piece together the information I needed to get started. I recommend you break this up into three steps: Installing Windows Server AppFabric Configuring […]
by community-syndication | Aug 13, 2010 | BizTalk Community Blogs via Syndication
Looks like some slipped through the cracks on SP1 upgrades with BTARN installed. If the process hangs with the command box open check the setup log. It may look like this.
. . .
[08/13/10 11:42:12] Package Microsoft BizTalk Accelerator for RosettaNet 3.5 is installed.
[08/13/10 11:42:12] Package code is {394EFEF0-99D2-4DBA-9446-0664E62ACEAF}.
[08/13/10 11:42:12] Performing post-installation custom actions. 1 actions to perform.
[08/13/10 11:42:12] Starting process "C:\Documents and Settings\All Users\Application Data\Microsoft\E-Business Servers Updates\Updates\UninstallSP1\Install.exe" …
The problem is “xcopy” is trying to copy a file and it already exists. This causes a hang condition. The fix is to let the install continue by killing the “xcopy” process in task manager. This should let the install finish. If the process remains in the hung condition after a minute or so kill the “install.exe” process and un-install the SP.
If you have to re-install avoid the issue by deleting the file “C:\WINDOWS\system32\AcceleratorsInterop.dll “. Then run the SP again. Be sure to read the install document with the SP. It has several required manual steps like un-enlisting the BTARN orchestrations.
by community-syndication | Aug 13, 2010 | BizTalk Community Blogs via Syndication
Hi all
For those interested in the Danish BizTalk User Group (DBUG), at LinkedIn group has
been created, free for everyone to join.
Find it here: http://www.linkedin.com/groups?gid=3305228
—
eliasen
by community-syndication | Aug 13, 2010 | BizTalk Community Blogs via Syndication
The second episode of our interview about SO-Aware for Endpoint TV is now available at http://channel9.msdn.com/shows/Endpoint/endpointtv-Meet-SO-Aware-Part-2/ . This part focuses on service testing, monitoring, extensibility and the PowerShell provider…(read more)