How I built my first Kotlin-VertX-Hibernate stack

Hashnode Original


Write your comment…

Very informative. Thanks for writing this. :)

Write a reply...

A few small suggestions. Vert.x web Router has a 'blockingHandler' so that you don't need the extra calls to 'executeBlocking', and therefore have simpler code. Secondly, you can pass the instance of EntityManagerFactory to your verticles in a constructor and use it in any of your code as long as it is declared 'final'. Finally, you could have a 'Main class which starts your Vert.x app by calling 'Vertx.vert()' and do your blocking configuration (Hibernate/LiquiBase/etc...) before you deploy your first Verticle.

1: router.get("/blocking").blockingHandler { it.response().end(" Hello World :-) ") },

I've seen that, the plan is to replace the blocking code with Quasar fibers at some point, hence the reason I've been writing it like that, but valid point :-)

In Kotlin + Quasars the executeBlocking would be replaced with fiber @Suspendable { .. blocking code .. }.get()

2: that sounds awesome, I did not know that. Do you have an example of that?

3: any major benefit doing it this way?

Write a reply...

Nice share. But, why you did not put this on github?

You are more than welcome to publish it on Github, I'll share the link here as well.

Write a reply...

Good work and nice write up! But the end result compared to what you'd get with Spring repositories and annotations is much more cluttered. I understand that you went down this path until Spring 5 stable is released but when that happens I don't see any reason someone would go with vertx+hibernate instead of that.

Great idea. I'm sure many people would be interested including myself. I also would like to see kotlin coroutines with vertx APIs. They have been nicely integrated with spring 5

Write a reply...

Join a friendly and inclusive Q&A network for coders

  • 🖥Pick the technologies you like & read great content through your feed.
  • 💬Ask a question when you want to learn more about anything.
  • 🚀Share what you know & build your portfolio.
Sign up nowLearn more

loading ...