2012-10-12 30 views
1

我一直在努力實現以下適配器的StreamInsight與BizTalk連接: http://seroter.wordpress.com/2010/07/09/sending-streaminsight-events-to-biztalk-through-new-web-soaprest-adapter/#comment-11635的StreamInsight 2.1適配器觀察者

在結束時,他確實下到查詢到適配器綁定:

var allQuery = callTypeThreshold.ToQuery(
        myApp, 
        "Threshold Events", 
        string.Empty, 
        typeof(WebOutputFactory), 
        webAdapterBizTalkConfig, 
        EventShape.Point, 
        StreamEventOrder.FullyOrdered); 

現在,如果我沒有弄錯,StreamInsight 2.1中不再有效,我不知道該怎麼做。任何人都可以幫助我嗎? 在此先感謝!

回答

2

您可以將舊適配器模型與較新的StreamInsight 2.1 API配合使用。要使用輸入適配器作爲源,您需要使用Application.DefineStreamable()的超載。

所以你的代碼會是這個樣子:

var sourceStreamable = Application.DefineStreamable<TPayload>(
typeof(WebInputFactory), 
webAdapterBizTalkConfig, 
EventShape.Point, 
AdvanceTimeSettings.IncreasingStartTime); 

現在,如果你想使用的輸出適配器作爲一個接收器,你需要使用的Application.DefineStreamableSink()的重載之一。

這樣的代碼會是這個樣子:

var sink = Application.DefineStreamableSink<TPayload>(
typeof(WebOutputFactory), 
webAdapterBizTalkConfig, 
EventShape.Point, 
StreamEventOrder.FullyOrdered); 

然後,只需使用()的bind()方法,然後運行啓動進程綁定您的流式傳輸到接收器,你是好去。