Issue
I am new to Memcached. I need to configure my spring boot application with Memcached.
I researched a lot on the topic but I could not find a documentation for the same. By default Spring boot uses Concurrent HashMap for caching but how do I configure Memcached.
I got this GitHub URL but I am not sure if this is the correct way and if so how do I use the same.
https://github.com/sixhours-team/memcached-spring-boot
Update
I have used this in my project now https://github.com/bmatthews68/memcached-spring-boot-starter.
Like this
@Override @Cacheable(value = "defaultCache")
public String customMethof() throws InterruptedException {
return "Testing";
}
but when i do a telnet of get defaultCache i get nothing Please help
Solution
Add this to your Gradle Dependencies
compile group: 'net.spy', name: 'spymemcached', version: '2.12.3'
compile('com.btmatthews.springboot:memcached-spring-boot-starter:1.0.0')
On top of your main Spring boot application where you @SpringBootApplication
this annotation put this
@EnableMemcached
Then in your Component use the following
@Autowired
private MemcachedClient memcachedClient;
memcachedClient.get("...")
Answered By - Rahul Singh Answer Checked By - David Marino (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.