spring-session-redis and serialization

73 views
Skip to first unread message

Rishabh Handa

unread,
Dec 15, 2021, 5:05:48 AM12/15/21
to Jedis
Hi,

I'm new to redis and trying to integrate it with java spring.
I've a session scoped @Configuration class which has multiple @Autowired variables. These variables include some of the classes like java.sql.DataSource (which are not serializable) and other custom classes. 

As I'm storing spring session in redis, I'm not able to store this Configuration class in redis as it is giving me serialization errors.

What I've found is every session scoped bean is added to session attributes and every session attribute is stored in redis via serialization.

Can somebody please suggest me an approach to store this class in redis ??

OR

Is there a way to not include these session scoped beans as session attributes and hence, restrict them from getting stored in redis.


If I mark these Autowired variables as transient, It comes as null when the object is deserialized.

Thanks in advance,
Rishabh

Sazzadul Hoque

unread,
Dec 15, 2021, 7:53:08 AM12/15/21
to jedis...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Jedis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jedis_redis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jedis_redis/cc01e907-afcf-4021-84be-be173865eee5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages