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

Quarkus reactive programming support #3

Open
danielpetisme opened this issue Jan 6, 2020 · 11 comments
Open

Quarkus reactive programming support #3

danielpetisme opened this issue Jan 6, 2020 · 11 comments
Labels
$$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ enhancement New feature or request good first issue Good for newcomers $500 https://www.jhipster.tech/bug-bounties/

Comments

@danielpetisme
Copy link
Member

Quarkus proposes a neat reactive programming model (which can be used side by side with the imperative model).

The objective is to propose to the user to choose the programming model and generate the according templates.

@danielpetisme danielpetisme added the good first issue Good for newcomers label Jan 6, 2020
@ghost
Copy link

ghost commented Jan 7, 2020

I can do this.

@ghost
Copy link

ghost commented Jan 8, 2020

The jhister cli already provides a reactive option.. we have only to add related templates for the generic app (for data layer we have to refer to the other issues)

@danielpetisme
Copy link
Member Author

You right, is 100% templates.

Couple of pointers:
https://quarkus.io/guides/reactive-routes
https://quarkus.io/guides/reactive-sql-clients

Quarkus "reactivity" relies on Vert.x but there is a "callback-free" API for the Web layer so I propose to focus on this one first.

Ping me if you need help, I have couple of contacts.

@joewhite101 joewhite101 added this to the v1.0.0 milestone Sep 12, 2020
@joewhite101 joewhite101 added the enhancement New feature or request label Sep 12, 2020
@avdev4j
Copy link
Contributor

avdev4j commented Dec 2, 2020

@danielpetisme @joewhite101
I suggest to remove this feature from the 1.0.0 milestone. The effort needed seems to be too high.

For me, it makes sens to have a first release without reactive programming and define a plan for next version, adding this feature step by step.

WDYT?

@danielpetisme
Copy link
Member Author

Moving to reactive is a major step.
Where web and service are quite easy to migrate, data is way more tricky.
As for now, Quarkus does not provide a "reactive" ORM. This means for the application developer to write the CRUD SQL statements manually and for a code generator like JHipster... well to actually generate those queries (which is basically the job of the ORM 🤔 ).

You get my +1 to postpone reactive to a post-1.0 realease. IMHO, concerning database access we should definitively wait for a native support from Quarkus or give a very high bounty.

@avdev4j avdev4j removed this from the v1.0.0 milestone Dec 2, 2020
@avdev4j
Copy link
Contributor

avdev4j commented Dec 2, 2020

I'm totally aligned with that, let's remove from 1.0.0.

@mraible mraible added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $500 https://www.jhipster.tech/bug-bounties/ labels Mar 3, 2021
@vivekmore
Copy link

Interested in working on this

@avdev4j
Copy link
Contributor

avdev4j commented Sep 21, 2021

feel free @vivekmore
I think @danielpetisme already prepare the field by creating partials. Anyway, we should avoid the mess we have on the official JHipster project mixing reactive and not in the same templates (as most as possible).

@vivekmore
Copy link

vivekmore commented Sep 21, 2021

Thanks @avdev4j
I just wanted to make sure someone isn't already working on it.

In addition to the partials, could you share any information that could help me get started on this?

@danielpetisme
Copy link
Member Author

Hi,

I started a long time ago but I crash my machine and lost the code (yes it happens in real life...).
Anycase, feel free to progress on this one.

A couple of advice:
1- isolate the imperative and reactive code in separate partials. I would recommend to isolate in a per method granularity (like list_imperative.ejs and list_reactive.ejs it's way easier to debug.

2- For now, do not try to have ordered imports, let the first prettier Java execution trigger at the code generation handle that for you

3- When using mutiny, queries are composable. I would suggest to made small human-readable queries and then compose them. JHipster Spring reactive tend to have a huge block that is hard to troubleshoot, please break down in smaller blocks.

4- Mutiny has no Uni implicit null filtering. If you want to prevent NPE, you need to eagerly filter the null value and throw the exception to fail fast.

Let me know if you need more guidance, I would do my best to help you.

@vivekmore
Copy link

Thank you 👍🏻
These are great advice and starter points!

I'll start looking at the blueprint code and Quarkus.

I feel I should also declare that, I'm mostly familiar with JHipster generator code and Spring and am new to Quarkus framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
$$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ enhancement New feature or request good first issue Good for newcomers $500 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

No branches or pull requests

5 participants