1
我正在爲我的appfabric緩存配置通知。第一個添加操作是發送一個通知。但是,當我用新值替換(更新)相同的緩存項目或刪除該項目時,我正在接收該單一操作的多個通知。我懷疑它與我執行的操作類型無關。因爲我看到了多個添加通知。有什麼配置我搞亂? 我已將代表寫入了我的代碼回覆文件。即使對於單一操作,它也持續地打擊代表一段時間。appfabric緩存中收到重複通知
我的配置是:
<dataCacheClient requestTimeout="150000" channelOpenTimeout="19000" maxConnectionsToServer="10">
<localCache isEnabled="true" sync="TimeoutBased" ttlValue="300" objectCount="10000"/>
<clientNotification pollInterval="30" maxQueueLength="10000" />
<hosts>
<host name="192.10.14.20" cachePort="22233"/>
</hosts>
<securityProperties mode="None" protectionLevel="None" />
<transportProperties connectionBufferSize="131072" maxBufferPoolSize="268435456"
maxBufferSize="8388608" maxOutputDelay="2" channelInitializationTimeout="60000"
receiveTimeout="600000"/>
</dataCacheClient>
我的代碼,有代表是:
public void myCacheLvlDelegate(string myCacheName, string myRegion, string myKey, DataCacheItemVersion itemVersion, DataCacheOperations OperationId, DataCacheNotificationDescriptor nd)
{
//display some of the delegate parameters
StringBuilder ResponseOfCache = new StringBuilder("A cache-level notification was triggered!");
ResponseOfCache.Append(" ; Cache: " + myCacheName);
ResponseOfCache.Append(" ; Region: " + myRegion);
ResponseOfCache.Append(" ; Key: " + myKey);
ResponseOfCache.Append(" ; Operation: " + OperationId.ToString());
string value = ManualDataCacheOperations.GetCacheValue(myTestCache, txtKey.Text).ToString();
Legend.Append(string.Format("{0} - Operation {1} Performed at {2}{3}", myKey, OperationId.ToString(), DateTime.Now.ToShortTimeString(), Environment.NewLine));
}
請讓我知道我失去了它?爲什麼它爲同一項目發送多個通知。如果它有任何用處,我正在使用兩臺主機的集羣。並且也使用相同的緩存進行會話管理。
感謝Cybermaxs, 我所看到的,爲什麼出現了問題。我錯誤地爲每個操作添加了一個回調。但是,還有第二個問題被注意到。第一次輪詢後,應用程序幾乎在下一次操作之後立即收到通知,而不是等待下一輪詢。有任何想法嗎?? –