<https://twitter.com/sdeleuze/status/9148165719855...
# spring
x
@sdeleuze Is JPA finally included? 🤔
s
@x80486 Included in what ?
x
Spring Data now supports #Reactive repositories and #Kotlin
<- Is Spring Data JPA also included?
s
In Reactive support no, JPA is blocking by design
JPA support take avantage of null-safe APIs
Not of immutable class support since object mapping is handled by the underlying JPA implementation
And JPA require a default constructor
(could be not public)
So yes it is included in Spring Data Kay but leverage only a subset of Kotlin related features and can't leverage Reactive support
x
Got it, but I thought that, at some point, Spring Data JPA will be doing something similar to, for instance, what Vert.x guys have for their JDBC module...
s
Not sure yet, it is already possible to wrap blocking JDBC or JPA blocking calls into dedicated schedulers via Reactor
publishOn
/
subscribeOn
. I guess we could provide some facilities for such use case, but currently our recommendation if more to use Spring MVC if you need to use such blocking library.
Also first class non-blocking SQL drivers may come at some point
x
That would be great! Let me upgrade and try this new one in the meantime...thanks!
s
Any feedback welcome, also if you have example of WebFlux + JPA wrapped into schedulers via Reactor
publishOn
+
subscribeOn
don't hesitate to share.
@dh44t That could be also an interesting blog post as a follow up of https://medium.com/@mario.arias.c/spring-5-jdbc-support-for-kotlin-7cc31f4db4a5, explain what is currently required to run it via WebFlux, pros and cons
Or maybe just discussing that here before a blog post as you prefer
Maybe with a few extensions we could make that usable easily
Or maybe just a wrapper for JDBC template specifying the scheduler to use for running JDBC requests and use the right method (
publishOn
or
subscribeOn
) on each
JdbcTemplate
method
Not exactly
JdbcTemplate
methods but reactive variants
Returning
Mono<T>
of the original
T
return type
d
Sounds good
Let's say
ReactiveJdbcTemplate
, develop in Java or Kotlin?
Maybe Java based with Kotlin extensions?