-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Be clearer about "reactive" repositories #17
Comments
Great point @keilw when we talk about this topic, we can work with |
Like Spring Data JPA, it allows you to use a Aligned with Java/Jakarta, I would like used Java 9 Flow by default for the ReactiveRepository. SmallRye Mutiny is switched to Java 9 Flow by default, which can be used as backend implementations. |
In Spring framework, it used Reactor by default, and used a RactiveAdaterRegistry to register other Reactive Streams lib, and convert between them. Here we can focus on Java 9 FLow, and other reactive streams, we can also used a similar mechanism to handle it. |
I would just like to point out that the current revision of the spec, as it exists today already fully supports reactive repositories! (They're just not portable between providers.) The following code is a perfectly legal and reasonable Jakarta Data repository, though of course the Jakarta Data provider must be written to allow it: @Repository
public interface ReactiveBooks {
@Insert
Uni<Void> persist(Book book);
@Find
Uni<Book> getBook(String isbn);
@Query("from Book where title like :title")
Uni<List<Book>> booksByTitle(String title)
} Now, I just noticed that the current javadoc of |
The Javadoc for those methods seems pretty restrictive, how are you thinking of modifying it to allow @Query("from Book where title like :title")
Uni<List<Book>> booksByTitle(String title) Wouldn't it be preferable to return a Also, would the spec need to clarify that vendor-specific subtypes are allowed, with the understanding that their use would prevent portability? |
I mean, just by adding weasel-words, for example:
or:
Something like that. Just leaving the door slightly ajar should be enough for now.
Haha, that's what everyone asks the first time the see Hibernate Reactive. The answer is "no", at least as far as today's relational database protocols go. But I'm not sure about NoSQL protocols. For those
We could add a note to that effect. |
Description
The current ReactiveRepository is meaningless and confusing, because it creates a fake impression of being a "Generic Reactive" repository type which does not work.
RxJavaReactiveStreams highlights, the two different incompatible concepts of these two (RxJava and Reactive Streams), add the JDK Async Flow and you have a possible combination between 3 incompatible types.
java.util.concurrent also says nothing about "reactive", hence calling it along the lines of Micronaut AsyncCrudRepository seems more sensitive.
@graemerocher said in #8 (comment), something like
FlowRepository
would be OK. If Micronaut'sAsyncCrudRepository
(working with CompletableFuture) was also worth supporting, then bothAsyncCrudRepository
or sayFutureCrudRepository
might exist side-by-side with aFlowRepository
orFlowCrudRepository
(if others like pageable variants also apply) while the generic "reactive" term sounds meaningless like a source for buzzword bingo where no common denominator could be found between all the mentioned concurrent/async APIs the JDK provides asFlow
andFuture
are not interpoerable or build on top of each other either.The text was updated successfully, but these errors were encountered: