Reputation: 315
I am using Spring boot. Application uses JWT token(another micro service) for authentication. I have to implement caching of JWT token. I am using Caffeine Cache.
Problem: Now the problem is this token expiry time is always dynamic and i have to match token expiry time with Cache expiry time. i.e.
Cache expiry time <= Token expiry time
Question: Is there any way to achieve this using Spring Cache?
Can we set value of below property dynamically, depends on JWT token expiry time?
spring.cache.caffeine.spec=expireAfterWrite=600s
Upvotes: 0
Views: 602
Reputation: 11
You can use System.setProperty()
to change the value of environment variable from code.
Upvotes: 0