I have been looking all over the internet on how to configure Spring MVC 3 with redis but all in vain. I want to connect to redis using Spring MVC 3.
I have worked with spring boot and spring-data-redis and everything is working fine. I can connect to redis and store sessions. But the project I am currently working on is legacy based. It uses spring 3 but I believe spring-data-redis is compatible with spring 4 and above. Are there any alternates to make connection between spring 3 and redis. Any tutorial would be helpful.
I expect to store session data like username in the redis using Spring MVC 3
Well, from the documentation of the oldiest available spring-data-redis release
it looks like the minimal 2.x version is indeed spring 4
However, Spring data redis 1.x should work with spring 3.x:
https://docs.spring.io/spring-data/redis/docs/1.4.0.M1/reference/htmlsingle/#why-spring-redis
Having said that I haven't tried it by myself and if you're only storing sessions in redis, maybe using spring data is an overkill.
After all you can create a Jedis plugin by yourself, expose it as a bean and call the commands directly via the jedis driver. Its also possible to go with reactive client...
Related
Ehcache works fine in my spring boot app without any problem, but when I run two/more instance of same microservice, data is inconsistent (each spring boot app is having one cache store) how can i implement distributed cache only by using ehcache is it possible ?. Downvoters comments please.
Note : I dont want to use redis database
I am using spring boot in my application, i want to know how to use Spring boot, iBatis and MySQL. While i am trying to find the reference for Spring boot with iBatis projects its automatically redirect to myBatis. I need a example project or site for referring this. I have example for mybatis but i want ibatis with spring boot.
I think, you shouldn't think how you may connect them. Just read docs about iBatis(MyBatis). But the following link special for you http://www.mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/
I have a spring-jpa-mvc-rest-hibernate web application that I use Java Config almost 99% on the whole app.
How can I configure Session per Request on pure Java Config? Preferable not using hibernate specific code, if that is possible.
I'm using Spring 4.2.2.RELEASE, Spring Data 1.11.0.RELEASE, Spring JPA 1.9.0.RELEASE, Spring WebMVC 4.2.2.RELEASE and Hibernate 5.0.2.Final.
Thanks a lot.
I am building a project with Dropwizard, Couchbase and ElasticSearch.
I am looking for a persistence layer like an ODM for Dropwizard and CouchBase. I looked over and found Spring-data-couchbase. Can I integrate DropWizard with Spring-data-couchbase and just use Spring-data-couchbase just for persistence? If I just use Spring-data-couchbase will it create an IOC container?
if you are looking for an ODM layer, we recently added a light one to the Java SDK, see Entity Mapping: http://blog.couchbase.com/javasdk-2.2-dp
Also if you are looking to use Spring Data Couchbase, you should maybe look into Spring boot, that basically does the same things as DropWizard. But of course Spring Data Couchbase is more integrated with Spring Boot than DropWizard.
As for DropWizard and Spring, yes I guess you would drag some Spring dependency in there so it might create some stuff that already have an equivalent in Dropwizard. But I have no knowledge of Dropwizard so, not sure.
I have a Spring based application that uses Spring core, Spring MVC and Spring Data (Mongo) on the server side, and designed as a typical 3-tier application.
I have a list of services, that are typical Spring services/beans that I wish you integrate with memcached to cache some of my service results.
Can someone guide me to the steps to integrate memcached with spring for such an application?
A sample/tutorial/blog that gives a step by step process would be just great.
Thanks.
If you use Spring 3.1 take a look at Spring Cache abstraction. It's the easiest way to integrate caching in Spring application. Unfortunately Spring doesn't support memcached out of the box, there's only support for ehcache.
As far as I know there isn't available any provider that can store data to memcached through Spring Cache. In few days next version 3.0.0 of Simple Spring Memcached is going to be released with such support. In mean time you may try one of the latest snapshot or use Simple Spring Memcached 2.0.0 directly without Spring Cache abstraction.
UPDATE: Simple Spring Memcached 3.0.0 with Spring Cache integration is already available.
It's very trivial to do. You can look at 3levelmemcache project as an example at github its Spring based abstraction.