I am using Java, Spring-Boot, Redis 7.0.4, and lettuce 6.2.0.RELEASE. I wrote a Lua script as below: Then I registered it as a function in my Redis using the below command: Now I can easily call my function using Redis-cli as below: And it will get executed successfully!! Now I want to call my function using lettuce which is my
Tag: redis
Jedis does not support returning PendingMessagesSummary
When I start the spring app write with Java 11, show error like this: I have already upgrade the Jedis version to the newest 4.2.3, why still did not support the Redis pending command? I have already read the Jedis issue. They already added the pending support in the Jedis 3.6.0, why still tell me that did not support? This
Can Make Redis server return NULL or False instead of JedisConnectionException?
We are developing an application that uses the Redis server as a cache server. So what We do are when a client request API it first go to Redis to get data if there is no data it returns null so the second step go to the MYSQL database to get data, But the problem when we lose the Redis
Getting a key/keys from ReactiveRedisOperations always return empty result
I am migrating my traditional Redis cache to the Spring Data Reactive Redis. After migration I would like to test if my new integration works as expected but I faced a problem with getting key/keys from particular Redis Db, namely: My redisConfiguration class looks like this: My “test” class looks like: While getting key/keys I am always receiving empty Mono/Flux
Delete multiple Redis stream id with Jedis
how can i delete multi redis stream id with jedis? they have a methods calls “xdel” – what is the type that i need to send to the method to delete multi key? i declare List but the method didnt get this type. i got this error – Answer Jedis xdel method takes varags of StreamEntryID. So you can do
Spring Data with Redis: How do I use a different LocalDateTime format or a different convertor?
I have data in my DB for field date with the following format: 2021-09-21 11:25:36. The Redis field is of type TEXT. When I’m trying to read the data from date field from the DB, I get following exception: How can I assign a different convertor to this field in my entity or annotate that my LocalDateTime format is different
Access Redis connection pool using Spring Data Redis without Reflection API
Please help me here with the solution. I want to monitor and periodically log information about the Redis Connection Pool usage in my application. I am using use Redis via spring-data-redis RedisTemplate object. I know that we can access pool through Reflection API as below. Since the pool is accessing through Reflection, during SAST scan we will be getting ‘Access
RedisTemplate mock is only working in the test class
Class B Now when I am writing the test for method in class B i.e. someMethod(). I have observed that the redis template mock is generating in test class but not in Class A and class B Inside ClassBTest Inside class B Why is the mock not working in class B and A ? Answer My issue is resolved now.
Redisson for JCache Session persistence on WebSphere-Liberty: how to pass redisson-jcache.yaml?
Hello Open Liberty experts, As an R&D effort, I am trying to enable Liberty session persistence backed by Redis via JCache/Redisson. I observe the CLASSPATH seems to be correctly configured via <library> and <httpSessionCache libraryRef> syntax, but the config file is not being passed to org.redisson.jcache.JCacheManager.createCache(). This method is an implementation of javax.cache.CacheManager.createCache() Here is my server.xml: Regardless of what
Spring data redis – How to use hashOperation’s scan method to get keys or values based on pattern?
I have never worked on Redis and Spring boot. I want to use Redis as a cache. I have been using hashOperations for get/set operations. I have configured the RedisTemplate to stop weird hashes from getting prepended to a key. I have a class called Post which I am caching. A user can create multiple posts. The key gets generated