Skip to content
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

Use of flux return types should not fail on custom spring data rest repositories [DATACMNS-1428] #1859

Closed
spring-projects-issues opened this issue Nov 30, 2018 · 3 comments
Assignees
Labels
in: core in: repository status: declined type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Nov 30, 2018

Gaurav Rawat opened DATACMNS-1428 and commented

Currently in boot 2.1 with spring data kay we get an error if we try to use reactive methods in repositories implementations that don't support reactive repositories . This is understood but I guess it shouldn't fail in case we are trying to use custom repositories (providing custom method implementations to repository) and providing our own implementation methods .

This used to work fine before , I guess at-least exclude custom repositories here from the check .

error below
.s.boot.SpringApplication - Application run failed org.springframework.dao.InvalidDataAccessApiUsageException: Reactive Repositories are not supported by Elasticsearch. Offending repository is

if not what are the alternatives we have , create custom service classes ? This is becoming a roadblock in us upgrading to 2.1


Affects: 2.0.12 (Kay SR12)

Reference URL: spring-projects/spring-boot#15356 (comment)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 30, 2018

Oliver Drotbohm commented

I don't think we're gonna change this restriction. The reason is as follows: imagine we'd allow that. This would mean you could naturally invoke a blocking repository hidden in a Flux in a reactive pipeline and absolutely nothing would hind at the fact, that you block the pipeline. If things stay as they are, you manually need to use Flux.fromIterable(…) and – by that – make obvious that you're invoking a blocking method right in the pipeline. This is important information to others reading the code.

Spring Data Elasticsearch doesn't support a reactive API as of today, but there are efforts underway to actually implement that. Maybe it's just worth waiting for that? That said, I'd still love to learn about why you're using Spring Data Elasticsearch in a reactive context as it completely subverts the benefits you'd get from a reactive application in the first place

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 30, 2019

Gaurav Rawat commented

I agree with the above , we are using the flux from iterable right now in separate service classes instead of using from the repository pre boot 2.0

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 13, 2019

Mark Paluch commented

Closing as we cannot do anything about reactive types and Spring Data REST here. Also, adding WebFlux support to Spring Data REST would require a rewrite of the entire module

@spring-projects-issues spring-projects-issues added type: bug status: declined in: repository in: core labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core in: repository status: declined type: bug
Projects
None yet
Development

No branches or pull requests

2 participants