Skip to content

Lessons learnt

Tomas Stenlund edited this page Jul 31, 2022 · 5 revisions

This log contains discoveries made during development that forced the project to make changes to the underlying solution. They are based on the Quarkus 2.10 release.

Flyway extension requires a JDBC datasource and cannot use the reactive datasource

Flyway cannot use the datasource used by the reactive Hibernate datasource. I therefore switched to manual (programmatically) to start the Flyway conversion using the same datasource configuration as hibernate, but changing it to a JDBC connection and connect explicitly to the database for the Flyway conversion. See eu.stenlund.janus.model.base.JanusFlyway.

security-jpa extension is bound to the blocking hibernate-orm

Security-JPA extension is using the non reactive hibernate library, causing the application to not start. The reason why I looked at that extension was to get the userid/password handling for the form authentication automatically. Decision was to write two new IdentityProviders for authentication with userid/password and trusted authentication. See eu.stenlund.janus.ReactiveTrustedAuthentication and eu.stenlund.janus.ReactiveUsernamePasswordAuthentication.

Panache cannot be used when writing the IdentityProviders

The Panache extension does not work in the context of an IdentityProvider. This caused me to drop the entire Panache extension in favor of plain hibernate.

Was not able to make @SessionScoped work

For some reason, might be me ;-), I was not able to make @SessionScoped beans to work. The application needs some minimal session memory to make it more usable. So I added a @RequestScoped bean, the JanusSession, and some ServerRequestFilter to serialize and encrypt the session to and from a client side cookie. It works for now.