title: Spring reactive WebSession with JDBC (or R2DBC)
body: <p>I'm trying to migrate my Servlet-based application to Webflux and got stuck with session management. I've been using Spring session with Jdbc implementation (backed by PostgreSQL) for a while and my config looks like this:</p>
  <pre class="lang-java prettyprint-override"><code>    @Configuration
      @EnableSpringHttpSession
      public static class SessionConfig {
  
          @Bean
          public MapSessionRepository sessionRepository() {
              return new MapSessionRepository(new ConcurrentHashMap&lt;&gt;());
          }
      }
  </code></pre>
  <p>Now, as I understood <a href="https://docs.spring.io/spring-session/docs/current/reference/html5/#websession" rel="nofollow noreferrer">documentation</a> correctly, servlet-based <code>HttpSession</code> has been replaced with <code>WebSession</code> and I need to provide configuration like the following:</p>
  <pre class="lang-java prettyprint-override"><code>    @Configuration
      @EnableSpringWebSession
      public class SessionConfig {
  
          @Bean
          public ReactiveSessionRepository sessionRepository() {
              return ???
          }
      }
  </code></pre>
  <p>But I could not find any support for relational databases as there are only 2 implementations of <code>org.springframework.session.ReactiveSessionRepository</code> (from <code>&quot;org.springframework.session:spring-session-core:2.2.2.RELEASE&quot;</code>):</p>
  <ul>
  <li>Basic one - <code>ReactiveMapSessionRepository</code></li>
  <li>Redis-based one - <code>ReactiveRedisSessionRepository</code></li>
  </ul>
  <p>but unfortunately, they do not satisfy my requirement.</p>
  <p>I also could not find any notes neither for <code>&quot;org.springframework.session:spring-session-jdbc&quot;</code> support for <code>WebSessions</code>, nor for new R2DBC.</p>
  <hr />
  <p><strong>Is it possible to back <code>WebSessions</code> by relational database (e.g. Postgres) and if it is, how can I achieve this (which implementation should I use)?</strong> I know there are some issues with non-blocking operations support for relational databases but I wonder if I missed something and it's still possible.</p>
  <p>Thanks in advance</p>