ESB.EXT tries to resolve Itinerary when called by ESB Dispatcher component

Developer
Mar 25, 2010 at 12:15 PM
Edited Mar 25, 2010 at 12:26 PM

Hi

I'm getting an SQL exception from the ItineraryDB (Procedure or function 'Itinerary_getitinerary' expects parameter '@name', which was not supplied.) from the ESB Dispatcher component when using the ESB.EXT resolver in both the Itinerary Selector component and then in the itinerary itself and the itinerary performs a transform in the onramp stage (i.e. in the ESB Dispatcher). See logged exception below.

It seems like the ESB.EXT tries to resolve an Itinerary when it's called for the second time within the same pipeline (first call is to resolve Itinerary, the second call to resolve the Map in the dispatcher), the following scenario should reproduce the problem

  • Scenario: A simple one-way messaging example with a transform+route itinerary (xml only)
  • BRE.EXT is used for resolution of both the Itinerary and in the Transform and Route stages in the itinerary
  • ESB receive pipeline used = ItinerarySelectReceiveXml
  • Itinerary Select resolver connectionstring = ESB.EXT:\\policy=ResolveItinerary;version=;useMsg=true;useMsgCtxt=true;msgCtxtValues=;recognizeMessageFormat=false
  • Transform is performed in the On-Ramp receive handler (i.e. the Microsoft.Practices.ESB.Services.Transform service called by ESB Dispatcher)
  • Using version 0.3 of EsbExtLibrary
  • Exception will be thrown by the dispatcher component in the receive pipeline.

I've verified that the itinerary is resolved properly in the ESB Itinerary Select component (the same type of exception is otherwise thrown by the ItinerarySelector when the BRE policy called fails to set the Itinerary name to retrieve.

Any suggestions???

Cheers

/Henrik

Logged exception:

Source: Microsoft.Practices.ESB.PipelineComponents.Dispatcher
Method: Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext, Microsoft.BizTalk.Message.Interop.IBaseMessage)
Error Source: .Net SqlClient Data Provider
Error TargetSite: Void OnError(System.Data.SqlClient.SqlException, Boolean) 
Error StackTrace:    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Practices.ESB.Resolver.Itinerary.DataAccess.SqlRepositoryProvider.InternalGetItinerary(String name, Nullable`1 majorVersion, Nullable`1 minorVersion)
   at Microsoft.Practices.ESB.Resolver.Itinerary.DataAccess.SqlRepositoryProvider.GetItinerary(String name)
   at Microsoft.Practices.ESB.Resolver.Itinerary.Facts.ItineraryFactTranslator.TranslateFact(Object[] facts, Dictionary`2 factDictionary)
   at Tellago.SOA.ESB.Extensions.Resolvers.BRE_ResolverProvider.SetAllResolutionDictionaryEntries(Object[] facts, Dictionary`2 factDictionary)
   at Tellago.SOA.ESB.Extensions.Resolvers.BRE_ResolverProvider.ResolveRules(String config, String resolver, XmlDocument message, Resolution resolution, BRE bre, Dictionary`2 ctxtValues)
   at Tellago.SOA.ESB.Extensions.Resolvers.BRE_ResolverProvider.Microsoft.Practices.ESB.Resolver.IResolveProvider.Resolve(String config, String resolver, IBaseMessage message, IPipelineContext pipelineContext)
   at Microsoft.Practices.ESB.Resolver.Unity.ResolveProvider.Resolve(String config, String resolver, IBaseMessage message, IPipelineContext pipelineContext)
   at Microsoft.Practices.ESB.Resolver.ResolverMgr.Resolve(ResolverInfo info, IBaseMessage message, IPipelineContext pipelineContext)
   at Microsoft.Practices.ESB.Itinerary.Services.TransformationService.ExecuteTransform(IPipelineContext context, IBaseMessage msg, String mapNameOrResolverString, Boolean validateSource)
   at Microsoft.Practices.ESB.Itinerary.Services.TransformationService.Execute(IPipelineContext context, IBaseMessage msg, String resolverString, IItineraryStep step)
   at Microsoft.Practices.ESB.PipelineComponents.Dispatcher.Execute(IPipelineContext context, IBaseMessage msg)

Developer
Mar 25, 2010 at 3:20 PM
Edited Mar 25, 2010 at 3:42 PM

Update

Using BRE.EXT for Itinerary selection works, but not as a resolver in an itinerary. The exception is thrown when BRE.EXT is only used as a resolver in the itinerary and the itinerary itself is specified in the receive pipeline using ITINERARY-STATIC.

Seems like BRE.EXT always tries to resolve an Itinerary... (could it be something in ESB.config that is missing? I'm using a fresh install of ESB Toolkit and EsbExtLibrary so nothing else is changed there...)

cheers

/Henrik

Coordinator
Mar 29, 2010 at 2:54 AM
Edited Mar 29, 2010 at 2:56 AM

Download the latest source code, recompile, and run the setup included with it., That should fix your problem.

 

Thanks

Developer
Mar 31, 2010 at 2:59 PM
Edited Mar 31, 2010 at 3:01 PM

Download and recompile done, but not without some hassle...

Current latest changeset (9b601992a1c9) goes into an infinite resolution loop at least when BRE.EXT is used in messaging scenario. v0.3 works fine in that perspective. Can't figure out why, might have something to do with setting Resolution.Success in SetAllResolutionDictionaryEntries method.

Setting useMsg = false in BRE.EXT setting will throw "Unable to cast object of type 'Tellago.SOA.ESB.Extensions.MessageContextFactRetriever' to type 'Microsoft.Practices.ESB.Resolver.Itinerary.Facts.ItineraryFact" exception from SetAllResolutionDictionaryEntries since the facts object array is different and the itineraryInfo object index is not constant.

See ResolveRules; objArray[] used as facts[] is either {resolution, document itineraryInfo, customFactRetriever}or {resolution, itineraryInfo, customFactRetriever} if useMsg is enabled or not.

Had to revert to v0.3 and only add the modifications to SetAllResolutionDictionaryEntries to be able to continue but would like to use the latest codebase (and be able to update message context from BRE)

cheers

/Henrik

Coordinator
Mar 31, 2010 at 10:34 PM

Ok I will take a look at it, this evening. Thanks.

Coordinator
Apr 7, 2010 at 2:03 AM

Ok inifinite loop and type exception fixed with this change set: http://esbextlibrary.codeplex.com/SourceControl/changeset/view/2dfdcfc74c6e

 

Developer
Apr 7, 2010 at 1:25 PM

Thanks, that part works now.

/Henrik