【问题标题】:spring-simple-memcache - maven dependencies for ReadThroughSingleCachespring-simple-memcache - ReadThroughSingleCache 的 Maven 依赖项
【发布时间】:2015-07-28 16:43:51
【问题描述】:

有人用过spring simple memcached吗?我无法获得确切的 Maven 依赖项和可用的存储库。 code.google 页面 (http://code.google.com/p/simple-spring-memcached/) 上提到的依赖项提到了其他依赖项,但它不包括 Simple-spring-memcache 本身的 jar。

感谢大家的帮助。

【问题讨论】:

  • 您需要接受一些答案。在 7 个问题中,您没有可接受的答案。

标签: spring memcached simple-spring-memcached ssm


【解决方案1】:

试试这个:

<dependency>
  <groupId>com.google.code.simple-spring-memcached</groupId>
  <artifactId>simple-spring-memcached</artifactId>
  <version>2.0.0</version>
</dependency>

【讨论】:

    【解决方案2】:

    如果是 SSM 2.0.0,您还需要 memcached 客户端(xmemcached 或 spymemcached):

    <dependency>
        <groupId>com.google.code.simple-spring-memcached</groupId>
        <artifactId>simple-spring-memcached</artifactId>
        <version>2.0.0</version>
    </dependency>
    <dependency>
        <groupId>com.googlecode.xmemcached</groupId>
        <artifactId>xmemcached</artifactId>
        <version>1.3.5</version>
    </dependency> 
    

    并配置与本地 memcached 服务器的连接:

    <beans xmlns="http://www.springframework.org/schema/beans" 
        xmlns:aop="http://www.springframework.org/schema/aop"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/aop
                http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
    
        <import resource="simplesm-context.xml" />
        <aop:aspectj-autoproxy />
    
        <bean name="defaultMemcachedClient" class="com.google.code.ssm.CacheFactory">
              <property name="cacheClientFactory">
                    <bean class="com.google.code.ssm.providers.xmemcached.MemcacheClientFactoryImpl" />
              </property>
              <property name="addressProvider">
                    <bean class="com.google.code.ssm.config.DefaultAddressProvider">
                         <property name="address" value="127.0.0.1:11211" />
                    </bean>
              </property>
              <property name="configuration">
                    <bean class="com.google.code.ssm.providers.CacheConfiguration">
                          <property name="consistentHashing" value="true" />
                    </bean>
              </property>
         </bean>
    </beans>
    

    【讨论】:

    • 谢谢拉格诺。看起来您现在已经更新了页面?也感谢页面上的详细文档。
    • 文档仍在建设中。我要改进它。随时在 simple-spring-memcached 邮件列表中提问:groups.google.com/group/simple-spring-memecached 在那里您可以获得快速答案。
    猜你喜欢
    • 2019-09-02
    • 2021-03-08
    • 1970-01-01
    • 2019-06-08
    • 1970-01-01
    • 2021-05-15
    • 2018-01-22
    • 2016-09-15
    • 2022-10-04
    相关资源
    最近更新 更多