Couchbase configuration based on the CacheManager component

Source: Internet
Author: User
Tags couchbase naming convention

Using the CacheManager component, when configuring Couchbase cache support, because of the configuration section cache handle naming rules requirements do not understand, took a little time to check the source to understand.

Section configuration Sections

<sectiongroupname="couchbaseclients"> < Sectionname="Couchbase" type="Couchbase.Configuration.Client.Providers.CouchbaseClientSection, Couchbase.netclient" /> </sectiongroup>

Cache node Configuration in CacheManager

<Managers> <Cachename="CacheName" UpdateMode=" up" Enablestatistics="false" enableperformancecounters="false"> <Handlename="Couchbaseclients/couchbase:default" ref="Couchbasehandle" Expirationmode="Absolute" Timeout="50s"/> </Cache> </Managers>
Note:

The Handlename naming convention must meet the couchbaseclientsection corresponding configuration section that can be found through the configuration name, that is, couchbaseclients under couchbase

Bucket name is optional, default defaults

Format is <configKey>:<bucketName>

Source Reference CacheManager.Couchbase.BucketCacheHandle

            //We can configure the bucket name by having "<configKey>:<bucketName>" as handle ' s//name VA Luevarnameparts = Configuration. Key.split (New[] { ":" }, stringsplitoptions.            Removeemptyentries); Ensure (Nameparts.length > 0,"Handle key is not valid {0}", configuration.            Key);  This. ConfigurationName = Nameparts[0]; if(Nameparts.length = = 2) { This. bucketname = nameparts[1]; }             This. Configuration =Couchbaseconfigurationmanager. GetConfiguration ( This. ConfigurationName);  This. bucketconfiguration =Couchbaseconfigurationmanager. Getbucketconfiguration ( This. Configuration, This. Bucketname);  This. Bucket =Couchbaseconfigurationmanager. Getbucket ( This. Configuration, This. ConfigurationName, This. bucketname);

Couchbase configuration based on the CacheManager component

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.