Coder Social home page Coder Social logo

redis-cache's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar emacarron avatar harawata avatar hazendaz avatar kanata2 avatar kazuki43zoo avatar laddcn avatar live106 avatar odirus avatar raupachz avatar renovate[bot] avatar shroman avatar songjiesdnu avatar suzhiwu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redis-cache's Issues

redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.
### Cause: redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371)
    at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198)
    at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
    at com.smarttrip.service.impl.StartDateService.selectByConditionMap(StartDateService.java:80)
    at com.smarttrip.service.impl.StartDateServiceTest.test(StartDateServiceTest.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:606)

has anybody account this problem?when i use redis-cli to connect redis, the password i write in redis.properties is white.

host=xxxx.xxxx.xxxx.xxxx
port=6379
connectionTimeout=5000
soTimeout=5000
password=111111
database=0
clientName=develop

If you use AliCloudDB for Redis,set the clientName to be empty.

I used AliCloudDB for Redis as my redis, and then occured an error, notice me that the command "client" was not supported.The i checked the source code, and found that, in the class RedisCache, when new a JedisPool, it set the clientName.But AliCloudDB for Redis does not support command "client" yet.

The solution is set the clientName to be empty in you redis config file.

Ssl not handled properly in redis 2.9.x

see [here] (e7d4f07)

This was partially highlighted by moving property file into right location to caues issue to occur on travis. The new params in that commit are now commented out. I'm looking at a solution I wrote a long while back but have basically no experience here so any community help would be appreciated.

Maven Project

The parseConfiguration method of the RedisConfigurationBuilder class, InputStream is dead, which means that can not be used in the maven project multi-environment configuration, such as the development environment, production environment, because this class is final type, so can modify from the classpath.

profile & jedis update

How to Adaptation environment? like this

dev read redis-dev.properties
test read redis-test.properties
prod read redis-prod.properties

Or, I'm use spring boot, use the profiles, how to read environment in org.springframework.boot.autoconfigure.data.redis.RedisProperties ?

And, If use the new jedis version(2.9.0)

pool = new JedisPool(...)

was error...

@hazendaz

when redis server down

if redis server down,i want direct query from db and not throw exception, how can i config?

Property name in redis.properties collided with jdbc.properties.

Hello

I found that in redis.properties the property names must be host,port,password, otherwise mybatis will config the redis with the default value .

For example, below is my redis.properties

redis.host=192.168.1.10
redis.port=6379
redis.password=
redis.maxIdle=100
redis.maxActive=300
redis.maxWait=1000
redis.testOnBorrow=true
redis.timeout=100000

MyBatis cannot find host,port,password (and ingore the properties maxIdle,maxActive...),but set the host with default value localhost and I had got connection refused error.
I must define

host=192.168.1.10
port=6379
password=

In my project, there was also a property password in jdbc.properties, so...I must change the jdbc property name and modify dbcp config in spring config file carefully.

This problem confused me quite a time, it seems the redis server was not setup corrected at first...finally I found the truth above !

I wrote this issue for hoping others to avoid the same problem!

Could not get a resource from the pool

When i use redis-cache in my project ,it throws exception,as you see,"Could not get a resource from the pool".
this is more infomation

Cause: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool] with root cause

java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(DualStackPlainSocketImpl.java)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at redis.clients.jedis.Connection.connect(Connection.java:144)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:71)
at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1783)
at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:65)
at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:819)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:429)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:360)
at redis.clients.util.Pool.getResource(Pool.java:40)
at redis.clients.jedis.JedisPool.getResource(JedisPool.java:84)

Could not find artifact org.mybatis.caches:mybatis-redis:jar:1.0.0-SNAPSHOT when using Maven

trying to use redis via maven,

 <dependency>
    <groupId>org.mybatis.caches</groupId>
    <artifactId>mybatis-redis</artifactId>
    <version>1.0.0-SNAPSHOT</version>
  </dependency>

got this error,

Could not find artifact org.mybatis.caches:mybatis-redis:jar:1.0.0-SNAPSHOT -> [Help 1]

im using this example,

http://mybatis.github.io/redis-cache/index.html

do you have any idea what maven repositories should i use?
thank you.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yaml
  • actions/checkout v4
  • actions/setup-java v4
  • shogo82148/actions-setup-redis v1.33.0
.github/workflows/codeql.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/coveralls.yaml
  • actions/checkout v4
  • actions/setup-java v4
  • supercharge/redis-github-action 1.8.0
.github/workflows/site.yaml
  • actions/checkout v4
  • actions/setup-java v4
  • JamesIves/github-pages-deploy-action v4.6.0
.github/workflows/sonar.yaml
  • actions/checkout v4
  • actions/setup-java v4
  • supercharge/redis-github-action 1.8.0
.github/workflows/sonatype.yaml
  • actions/checkout v4
  • actions/setup-java v4
  • supercharge/redis-github-action 1.8.0
maven
pom.xml
  • org.mybatis:mybatis-parent 43
  • org.mybatis:mybatis 3.5.16
  • redis.clients:jedis 5.1.2
  • com.esotericsoftware.kryo:kryo5 5.5.0
  • org.junit.jupiter:junit-jupiter-engine 5.10.2
  • org.slf4j:slf4j-simple 2.0.13
maven-wrapper
.mvn/wrapper/maven-wrapper.properties
  • maven 3.9.6
  • maven-wrapper 3.3.1

  • Check this box to trigger a request for Renovate to run again on this repository

beta3?

Hi there,

are there any updates on redis-cache? Anything needed to help out?

Last version is from 2015 and there have been many updates in Jedis and MyBatis.

Thank you for your time!

cache setting [flushInterval] not work

I use flushInterval like this:

<mapper namespace="cn.com.xxxxx.dao.mapper.TestMapper"> <cache type="org.mybatis.caches.redis.RedisCache" flushInterval="2000"/> ...

after more than 2 seconds,I use this query again,but I just see information like this(in console):

org.apache.ibatis.cache.decorators.LoggingCache:62 - Cache Hit Ratio [cn.com.chengyisheng.dao.mapper.TestMapper]: 0.875

It means this query use cache result again.

why? How to use flushInterval

version error

The src of the version 1.0.0-beta2 from maven are different from those from github.

especially, the constructor of RedisCache, as follow:

pool = new JedisPool(redisConfig, redisConfig.getHost(), redisConfig.getPort(),
redisConfig.getConnectionTimeout(), redisConfig.getSoTimeout(), redisConfig.getPassword(),
redisConfig.getDatabase(), redisConfig.getClientName());

which is not avaliable constructor of JedisPool of version 2.9.0...

or, is there anything i misunderstood?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.