redis-cache

Setting expiration for IDistributedCache.SetAsync while using AddDistributedRedisCache

白昼怎懂夜的黑 提交于 2021-01-27 12:11:08
问题 I am using .net core api (2.1) with aws redis cache. I don't see a way to set expiration to the IDistributedCache.SetAsync. How is it possible? My code segment is below: // Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddDistributedRedisCache(options => { var redisCacheUrl = Configuration["RedisCacheUrl"]; if (!string.IsNullOrEmpty(redisCacheUrl)) { options.Configuration = redisCacheUrl; } }); } //Set & GetCache public async Task<R> GetInsights<R>(string

Setting expiration for IDistributedCache.SetAsync while using AddDistributedRedisCache

放肆的年华 提交于 2021-01-27 12:00:53
问题 I am using .net core api (2.1) with aws redis cache. I don't see a way to set expiration to the IDistributedCache.SetAsync. How is it possible? My code segment is below: // Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddDistributedRedisCache(options => { var redisCacheUrl = Configuration["RedisCacheUrl"]; if (!string.IsNullOrEmpty(redisCacheUrl)) { options.Configuration = redisCacheUrl; } }); } //Set & GetCache public async Task<R> GetInsights<R>(string

How to use spring data redis pipeline to process 1 million records?

末鹿安然 提交于 2020-01-11 07:07:49
问题 I have a requirement where I have to read a file which contains around 1 million records each record in a separate line. Each record will be validated and then will be saved in Redis cache. I implemented this in a normal traditional way by reading each line and saving it in the Redis cache but it is hampering performance very badly. Then I came to know about Redis pipeline feature in which I will process records in a batch say 10k at a time in order to improve performance . How can I use this

java.lang.ClassCastException: DTOObject cannot be cast to DTOObject

半城伤御伤魂 提交于 2019-12-22 07:59:37
问题 I am facing a weird issue in my application which runs on Spring Boot 1.4.0M3 which is using Spring cache implementation where provider is Redis where I receive classCastException that same object cannot be casted I am using Mongodb as database and I have User Object which contains List of Roles object loaded lazily and Roles internally contains Permissions Object like below @Document @Data public class User implements Serializable{ private String passwordResetToken; private boolean enabled =

java.lang.ClassCastException: DTOObject cannot be cast to DTOObject

岁酱吖の 提交于 2019-12-05 17:42:21
I am facing a weird issue in my application which runs on Spring Boot 1.4.0M3 which is using Spring cache implementation where provider is Redis where I receive classCastException that same object cannot be casted I am using Mongodb as database and I have User Object which contains List of Roles object loaded lazily and Roles internally contains Permissions Object like below @Document @Data public class User implements Serializable{ private String passwordResetToken; private boolean enabled = false; @DBRef(lazy= true) private List<Role> roleList; } My Role DTO is as below @Data @Document

Can Redis write out to a database like PostgreSQL?

南笙酒味 提交于 2019-12-04 08:24:39
问题 I've been using PostgreSQL for the longest time. All of my data lives inside Postgres. I've recently looked into redis and it has a lot of powerful features that would otherwise take a couple of lines in Django (python) to do. Redis data is persistent as long the machine it's running on doesn't go down and you can configure it to write out the data it's storing to disk every 1000 keys or every 5 minutes or so depending on your choice. Redis would make a great cache and it would certainly

Why are connections to Azure Redis Cache so high?

醉酒当歌 提交于 2019-11-27 21:17:12
问题 I am using the Azure Redis Cache in a scenario of high load for a single machine querying the cache. This machine roughly gets and sets about 20 items per second. During daytime this increases, during nighttime this is less. So far, things have been working fine. Today I realized that the metric of "Connected Clients" is extremely high, although I only have 1 client that just constantly Gets and Sets items. Here is a screenshot of the metric I mean: My code looks like this: public class