How can you use Spring Sessions with Redis Service in Bluemix? Is IBM Session Cache an alternative?

686 Views Asked by At

The current app (with a competitor) is using Spring-Boot and Spring-Sessions to save session data independent from the instance in Redis.

How can we replicate this in Bluemix?

  1. Is there a way to add on Spring-Sessions to the Redis service?

  2. The other option would be the IBM Session Cache. Does that work with Spring-Boot and Spring-Session? Does the Session Cache service work without Tomcat? (Jetty for example?)

2

There are 2 best solutions below

0
Ram Vennam On BEST ANSWER

I haven't played with Spring-Sessions yet, but I might be able to point you in the right direction.

There is a general Redis service available on Bluemix. The open source Java buildpack (Tomcat) promises auto configuration of Redis. I would try this first. To use this buildpack:

cf push <appname> -b java_buildpack

If that doesn't work, you could read the credentials from VCAP_SERVICES and configure JedisConnectionFactory programmatically connect to it.

If you use the IBM Session Cache service with a Liberty application on Bluemix, the configuration is auto generated such that standard JEE HTTPSession objects are persisted to the service. It might work with other java runtimes, but configuration would be more manual.

Hope this helps.

0
Paul Chen On

Does the session cache work without Tomcat (Jetty for example)?

In general, the session cache should work with any webserver/servletcontainer, when Bluemix supports Jetty runtime for example, the session cache should support.

Session cache is based on IBM WebSphere eXtreme Scale caching technology, and the base product had been tested against WebSphere, Liberty and Tomcat runtime for the HTTP session use cases, but not tested under Jetty.