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
Vert.X hibernate reactive stage setup example #846
Comments
I don't think there is one at the moment. As far as the Hibernate Reactive session factory, you can get one that uses the Stage mode via:
You can then convert a Uni to a CompletionStage (and vice-versa) with:
Out of curiosity, why do you want to use the Stage mode? |
Thanks for the explanation, Iam sorry for opening insignificant case in issue, next time i will use forums instead. |
Yes, Mutiny is pretty stable. and they usually answer to question quite quickly You can find the website with all the details about the community here: https://smallrye.io/smallrye-mutiny/ Anyway, there's nothing wrong in using the CompletionStage API, I just find the Mutiny helps you write cleaner code. No need to be sorry, we like the feedback :-) |
I'm not sure there's a really strong need for a separate example showing Vert.x and |
I've created this JBang alias of the example that doesn't use Mutiny: https://github.com/DavideD/jbang-rep/blob/main/StageVerticle.java Once you have installed JBang, you can run it with:
And you can open it in your ide (IDEA for example) with:
(Even if you are not familiar with JBang, as long as you copy this class in a new project and add the dependencies at the top, it will work). Anyway, it should give you an idea on how to use Future and CompletionStage. Cheers. |
I'm closing this issue but let me know if you have further questions. |
Thanks to @DavideD and @gavinking, I have read and tried the example you gave, and it works. Sure i will try to use Mutiny, i just found out it provides some developer experiences than Stage API, i think. It's just that sometimes I have to be bound by policy to choose Stage or Mutiny. Regards |
@arifpratama398 I've noticed a couple of errors in the example. I wasn't completing all the promises and I was creating the factory twice. I've updated it. If you are using jbang, make sure to run it with Also, the original example never closes the factory, but I've added it to the stop method. |
Probably. |
I suppose that in this case it doesn't make any difference, but it's something to keep in mind for real applications. |
Hello guys, can you tell me where i can get example to setup vertx web with hibernate-reactive using Stage mode ?
I just could found this example which using Mutiny :
https://how-to.vertx.io/hibernate-reactive-howto/
Thanks in advance.
The text was updated successfully, but these errors were encountered: